-
Hi there, I'm developing an app which uses notifications on Android I noticed that before setting a notification listener or removing one a Right now I just ignored the errors generated by that failed write, since notifications then still work as expected What I noticed, digging deeper, is that using Is that permission actually needed for notifications to work? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Yes, notifications require BLUETOOTH_CONNECT , see https://developer.android.com/reference/android/bluetooth/BluetoothGatt#setCharacteristicNotification(android.bluetooth.BluetoothGattCharacteristic,%20boolean). This plugin request this permission in the initialize call. |
Beta Was this translation helpful? Give feedback.
-
I see, I guess this is the relevant code: https://github.com/capacitor-community/bluetooth-le/blob/main/android/src/main/java/com/capacitorjs/community/plugins/bluetoothle/BluetoothLe.kt#L104-L128 But does this mean we don't actually need to add Cause here it's mentioned that those must be added into the android manifest, but they're also required into the initialize call
This question is still bugging me tho |
Beta Was this translation helpful? Give feedback.
Yes, notifications require BLUETOOTH_CONNECT , see https://developer.android.com/reference/android/bluetooth/BluetoothGatt#setCharacteristicNotification(android.bluetooth.BluetoothGattCharacteristic,%20boolean). This plugin request this permission in the initialize call.