1.7k
Bluetooth
complete
Adrian Carolli
Similar to the API provided by https://github.com/Polidea/react-native-ble-plx
I work on a bluetooth connected medical device and have been using that library to do most of the bluetooth stuff. However, you must detach the expo app to get it working and the setup is non-trivial. It would be nice to have a bluetooth API built into the expo SDK.
Evan Bacon
complete
Today, we are pleased to announce that with the arrival of Expo SDK 42, you can now create custom development clients in the cloud using EAS Build, or locally with the new Expo run commands.
The upstream config plugin for
react-native-ble-plx
is still waiting to be merged. In the meantime, users can install an out-of-tree plugin @config-plugins/react-native-ble-plx (think of this like @types/*
for packages that don’t have TypeScript).You can try it out today:
- Create a new project: expo init
- Install the packages: expo add react-native-ble-plx @config-plugins/react-native-ble-plx expo-dev-client(can also use npm or yarn)
- Add @config-plugins/react-native-ble-plxto theexpo.pluginsarray in yourapp.json.
Build the native app:
- In the cloud with eas build -p all --profile development(expo build does not support custom builds)
- Or locally with expo run:ios -dandexpo run:android -d(-denables connected device selection, BLE doesn’t work on simulators).
These custom clients can be shared across teams, and even reused across projects (just like Expo Go).
To be clear,
react-native-ble-plx
has not
been added to the Expo Go app that you download from the App Store or Google Play Store. For now, this is the closest we can get to making BLE as easy to use as the rest of the Expo SDK.We still consider this feature to be completed because users can now:
- Create a custom client app without needing to write any native code.
- Build the iOS project without having access to an Apple computer.
We hope you enjoy, and we have big plans to continue improving this workflow going forward!
orome
Evan Bacon I'm a bit confused about the current status of all this and am wondering what's currently involved in getting Bluetooth working in my Expo project (and whether, perhaps with a Bluetooth emulator like
react-native-blemulator
I can get around having to leave Expo Go / iOS Simulator behind).João Mello Ferrari
orome: So am I. Would really appreciate an update on that!
Michael Wood
João Mello Ferrari: Yes, you should be able to add Bluetooth support to your app. Check the thread on the forums that orome linked to above. But apparently,
react-native-blemulator
doesn't work.R
Raamiz Abbasi
Any update on this in terms of improving the workflow and making this an Expo API that we can just install without having to use EAS build?
Y
Yuri Mosh
Has anyone tried building with
expo run:ios
on Mac? I am getting an error value of optional type 'CBService?' must be unwrapped to a value of type 'CBService'
The project is fresh new, created by instructions of Evan Bacon's post.
expo run:android
works fine.Does anyone know what is wrong?

Evan Bacon
complete
Evan Bacon
in progress
Evan Bacon
Update: I've opened a PR to add a prebuild config plugin to
react-native-ble-plx
. When merged, users will be able to add the package to Expo projects built on EAS build, or locally with expo run:ios
and expo run:android
(i.e. after running expo prebuild
to sync the plugin with the native project). We're also still working on the Expo dev client project, which will utilize this proposed config plugin to create a custom dev app that has BLE support.
Carlos Barilatti
Evan Bacon: The prebuild config plugin was merged in this PR.
Brent Vatne
we're focused on making it possible to add any library to managed expo apps, you can read about it here https://blog.expo.io/expo-managed-workflow-in-2021-d1c9b68aa10
M
Michael Golden
Brent Vatne: this sounds really promising! Humble suggestion: maybe the documentation/examples could be for https://github.com/Polidea/react-native-ble-plx or similar ;)
Jon Smirl
Brent Vatne: How about endorsing your own Expo version of WebRTC/Bluetooth libraries that can be easily added in? These libraries would be tested to work with Expo and documented on the Expo site. It would still be a managed Expo app, Expo would just be endorsing the specific library and lib version to use. This would not prevent anyone from using a different library. Using the libraries you tested would make integration a smooth process. For example you could ensure proper fallback behavior if the customer device is incapable of BT/WebRTC or make the cross platform API consistent.
I believe what I am looking for is predefined 'config plugins' for BT/WebRTC. Ultimately I'd like to be able to run expo init and say 'Y' to add support for WebRTC/BT and have everything configured for me.
Brent Vatne
Jon Smirl: there are plenty of features like bluetooth that also would benefit from attention, and so our priority now is not to focus on any individual api but instead on making it possible to let developers building apps w/ managed workflow to use any library that they want. we can then evaluate - and if all of the libraries out there to solve specific problems end up being insufficient, and contributing to improve them doesn't seem like the best option, then we would pursue building them at expo.
Jon Smirl
Brent Vatne: I believe what I am looking for is predefined 'config plugins' for BT/WebRTC. Ultimately I'd like to be able to run expo init and say 'Y' to add support for WebRTC/BT and have everything configured for me.
Previously I have added libraries and then discovered later that they were missing web support so I had to rework to remove them. So it would be nice to have a set of 'known good' libraries to choose from. Contributing upstream or forking them in house does not matter, it is the testing for expo compatibility that is important.
Brent Vatne
Jon Smirl: we plan to work with library authors to ensure config plugins are available and it’s easy to learn how to make one. support for web and so on is another issue though :) most library authors don’t care about it
Jon Smirl
Brent Vatne: I'm looking for a maintained list of 'config plugins' the the expo team has verified will work with Expo including web support and have also verified that they are compatible with the current SDK. Hopefully this list would have entries for at least three or four of the most heavily requested plugins like BT and WebRTC. Then I could use 'expo install' to set up the correct version. Not asking for all packages to be supported like this, just the heavily used ones.
Brent Vatne
Jon Smirl: web support is a separate topic and you can determine web compat by looking at https://reactnative.directory/
we are definitely interested in creating some tooling to ensure it's easy to get the correct version of a library for a given sdk version, even when that library does not exist within the expo sdk. we also will work with library authors on config plugins. we're likely to send prs to add config plugins to some of the more popular libraries or libraries that we use in our own projects, and help them set up tooling to ensure that their config plugin keep working.
i can't say there is much we can do when it comes to ensuring other libraries support web, though. we have tried to do this a lot already and what it comes down to is that if a library maintainer is not interested in it, they won't ensure that it keeps working over time even if we build the initial version.
N
No
Brent Vatne Evan Bacon do you have any news on it ? It was marked as Planned in 2017, do you expect it to be planned again soon ?
Michael Golden
This appears to be the #1 requested feature, and COVID is driving remote patient monitoring through the roof... now would be a great time for Expo to enable the community with this... how do we get this bumped to "planned"?
Bora Ciner
Isn't it still available?? :(
Load More
→