-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PeripheralManager.startAdvertising throws NullPointerException on Android #83
Comments
Thanks for this report, I didn't notice that PeripheralManager is unsupported on some devices, it's supported on all the devices I have tested. I will add this check in the next version, but I don't have a way to test this. |
Thank you. Unfortunately I don't have that device either (running Android 4.1.x). The report came from the crash reporting system. I wonder if the |
…nager` is supported on this device, closes #83 (#85) * Use `isMultipleAdvertisementSupported` to check whether `PeripheralManager` is supported on this device. * 6.0.2 * 6.0.2 --------- Co-authored-by: yanshouwang <[email protected]>
It looks like I'm still getting this error with
|
And another variant from Amazon tablet running Android 9.
|
Have you checked the bluetooth state before advertising? |
I've got a
NullPointerException
reported from some user's devices (Galaxy Tab A 7.0 SM-T280) whenPeripheralManager.startAdvertising
was called.According to Android docs the BluetoothAdapter.getBluetoothLeAdvertiser() can return null if Bluetooth is turned off or if Bluetooth LE Advertising is not supported on this device.
It would be nice if unsupported advertising handled more gracefully.
The text was updated successfully, but these errors were encountered: