Closed fesp closed 8 months ago
open a PR. no need to file an issue.
thanks though.
maybe this
FlutterBluePlus.setOptions({bool iosShowPowerAlert}}
open a PR. no need to file an issue.
thanks though.
You are right of course. I did have a go at it (with the setOptions
approach you mentioned above), but found that the very first method call is flutterHotRestart
, which causes CBCentralManager to initialise. Therefore setOptions
comes too late. Any thoughts on this?
don't use FlutterBluePlus._invokeMethod
instead directly call _methodChannel.invokeMethod
or maybe better, add an option to skip calling _initFlutterBluePlus in this function
static Future
Yes, that solved the issue. Thanks! Need to finish some work first but then I'll create the PR.
FlutterBluePlus Version
1.31.12
Flutter Version
3.19.4
What OS?
iOS
OS Version
17.3.1
Bluetooth Module
?
What is your feature request?
At the moment
CBCentralManagerOptionShowPowerAlertKey
is hardcoded toYES
. It would be nice if the app could set this toNO
. Currently my app shows a Flutter dialog if the Bluetooth adapter is turned off. But in order to detect this state I need to useFlutterBluePlus.adapterState
which causes the native dialog to appear.So at this point I have two dialogs. If then dismiss the native dialog, the Flutter dialog is still there (of course). It is not an option to remove the Flutter dialog because (as far as I know) there is no way to re-trigger the native dialog once dismissed.
Logs