capacitor-community / capacitor-community/bluetooth-le
Notifications not working on some Android devices
- Dominant language
- TypeScript
- Stars
- 361
- Forks
- 121
- Avg merge
- 10d 45m
- Merged PRs (30d)
- 2
Description
**Describe the bug**
On some android devices we are not receiving notifications.
Samsung not working, but OnePlus is working and iOS also working
**Our code:**
```
await BleClient.initialize({ androidNeverForLocation: true });
await BleClient.isEnabled();
device.value = await BleClient.requestDevice({
namePrefix: 'MUGSHOTT_',
services: [UART_SERVICE]
});
await BleClient.connect(device.value.deviceId, (deviceId: string) => onDisconnect(deviceId));
console.log('connected to device', device.value);
await BleClient.startNotifications(
device.value.deviceId,
UART_SERVICE,
UART_TX_CHAR_UUID_CMD,
(value: DataView) => {
console.log(value)
})
```
On the devices that it won't work we receive a uuid of 00000000-0000-0000-0000-000000000000 on the requestDevice call.
Anyone has some clue why this happens?
It's for a custom build device, could be the device?
Contributor guide
Research direction
Start by reproducing the requestDevice and startNotifications flow on the affected Samsung devices and compare its result with OnePlus and iOS. Investigate the reported all-zero device UUID and determine whether the failure is in the plugin flow or the custom device; done means identifying a reproducible cause and documenting or fixing the Android behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, typescript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100