Android 12 Support
See original GitHub issue- [ x] I am running the latest version
- [ x] I checked the documentation and found no answer
- [ x] I checked to make sure that this issue has not already been filed
- [ x] I’m sure that question is related to the library itself and not Bluetooth Low Energy or Classic in general. If that so, please post your question on StackOverflow or on our Gitter channel.
Question
Hey guys I’m wondering that if you have in plan to add support for Android 12 any time soon, cause I started to test how my app is working on Android 12 and I have some problems. When I’m disconnecting from the device I’m getting this error:
{
message: "Device ......... was disconnected"
errorCode: 201
attErrorCode: 0
iosErrorCode: null
androidErrorCode: null
reason: "Disconnected from ........... with status 0 (GATT_SUCCESS)"
name: "BleError"
}
which is good but attErrorCode is always 0 no matter what I do, I tried to go out of range, reset the device but the attErrorCode is not changing. I tested on a physical device Pixel 5 with Android 12 Beta 5. I couldn’t replicate this problem on any other device with any other version of android. I’m asking this question because I saw that Google made some changes around the Bluetooth permissions and I’m wondering if this might affect this library somehow. Currently, I’m running on: “react-native”: “0.63.3” “react-native-ble-plx”: “^2.0.2” So, can you please tell me if the Android 12 can impact you guys somehow and if you have anything planned to support Android 12?
Issue Analytics
- State:
- Created 2 years ago
- Comments:26
Top GitHub Comments
@mciechanowicz @bor-ski, sorry to tag you here, but we would need some help with this, or some clarity on the maintenance of the repo.
Currently,
react-native-ble-plx
uses a version of https://github.com/dotintent/MultiPlatformBleAdapter which is not wrapping the latestRxAndroidBle
library. Instead it wraps an old version ofRxAndroidBle
which does runtime checks on the permissions, requiring the Location permissions on Android 12 (withtargetSdkVersion 31+
) while it’s not needed, even if the new Bluetooth Permissions are granted. The latest version ofRxAndroidBle
doesn’t have this issue.It looks like the update should go in two steps:
RxAndroidBle
library. (can be tricky because you move from RxJava 1 to 2)react-native-ble-plx
so it uses the updatedMultiPlatformBleAdapter
Could you please clarify the status of the
react-native-ble-plx
project since.intent
took ownership? Should we look at alternative libraries? Forking and fixing it ourselves could be a solution, but if the project is no longer maintained by a community, and if the fixes never land on the main branch, it may not be a viable long term solution.Thanks
Hi @fabiendem and others
That’s exactly what we did here react-native-ble-plx We updated MultiPlatformBleAdapter to use the latest RxAndroidBle
We also pushed it to NPM
Not sure if it’s bulletproof, we didn’t go as far as using it in production yet but preliminary testing shows that it works well on Android 12.
It’s really sad that this library is no longer maintained.