cordova-plugin-ble-central icon indicating copy to clipboard operation
cordova-plugin-ble-central copied to clipboard

startNotification not returning any result for API level 33 (Pixel devices)

Open KumarSunil007 opened this issue 1 year ago • 2 comments

I have app which is running fine on 80% of devices but Google Pixel devices and Nokia devices (either Android 12 or 13 or 14), when connect is called, it is asking for Call History permission which is triggering Negative image for the app to the end users.

Also, The startNotification function doesn't provide any response and do nothing on these devices. The function neither returning error no returning Success callback.

Let me know can be done to avoid this Extra permission message and why I am not getting anything for startNotification function.

KumarSunil007 avatar Mar 20 '24 04:03 KumarSunil007

The Call History prompt something Android does itself as part of the bonding process. A reasonable overview of this process is recorded here: https://medium.com/@futail2a/why-android-requests-contacts-and-call-history-during-ble-pairing-deb2032c64f5

A few questions:

  1. I presume you have some encrypted characteristics on your Bluetooth device? If not, the first question is why you're getting a pairing request at all
  2. Does startNotification work if you call it after the pairing dialog is accepted?

This is unlikely to be anything related to this plugin however, as what you're running into is native Android behaviour that they don't expose APIs to control.

peitschie avatar Mar 20 '24 04:03 peitschie

Thanks @peitschie for prompt response. Here is answer for your queries.

  1. When I call the startNotification that time the permission popup is shown and it ask for Pairing. I am not calling pair function anywhere.
  2. After accepting pair request, nothing happen as I am not getting anything inside success or error callback.

I think the broadcast listener is not triggering any even for intent to send data back to callback function.

KumarSunil007 avatar Mar 20 '24 13:03 KumarSunil007