don / cordova-plugin-ble-central

Bluetooth Low Energy (BLE) Central plugin for Apache Cordova (aka PhoneGap)
Apache License 2.0
941 stars 601 forks source link

Need to show Authorise popup manually #996

Closed sivakavi-manurevasolutions closed 6 months ago

sivakavi-manurevasolutions commented 6 months ago

I need to show the authorise popup manually and ask permission to user in app home screen. I have attached the authorise pop. Screenshot_20231113_183909

peitschie commented 6 months ago

Hi @sivakavi-manurevasolutions

This pop-up will automatically show when you attempt a scan. The plugin will request any runtime permissions necessary to achieve the scanning. For Android 12, you'll need to be running at least version 1.6 of this plugin. I'd highly recommend using the latest version however.

If this doesn't function for you, please feel free to re-open this and we can discuss more!

sivakavi-manurevasolutions commented 6 months ago

@peitschie Thanks for your reply. Yes i have used latest version 1.7.1 only. Client asked us to app should ask this permission pop in the home page itself. Is there any option to show manually this permission popup.

peitschie commented 6 months ago

@sivakavi-manurevasolutions the best approach is using https://github.com/dpa99c/cordova-diagnostic-plugin#requestbluetoothauthorization

This plugin itself doesn't expose the necessary feature on it's own at the current state. Patches are welcome to address this however.