Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Fix request bluetooth permission on startup for iOS #3

Merged
merged 2 commits into from
Apr 5, 2022

Conversation

feelsoftware
Copy link

@feelsoftware feelsoftware commented Apr 5, 2022

pauldemarco#964

PR pauldemarco#599 delays centralManager initialization, but instantiating FlutterBlue in flutter calls into _setLogLevelIfAvailable() which calls into isAvailable and triggers a popup anyway.
This PR skips isAvailable call in the FlutterBlue constructor and allows setting of log level without initializing centralManager.
The side effect of this change is, for some reason, Bluetooth permission always returns "denied" until centralManager is initialized. Similarly, Bluetooth permission under App Settings does not appear until centralManager is initialized.

rohansingh and others added 2 commits October 18, 2021 15:04
By deferring the initialization of `CBCentralManager`, we are able to
defer prompting for Bluetooth permission on iOS until a flutter_blue
method is called. Otherwise, the Bluetooth permission prompt appears
right when the app starts up.
@feelsoftware feelsoftware changed the title Fix show bluetooth permission on startup for iOS Fix show bluetooth permission request on startup for iOS Apr 5, 2022
@feelsoftware feelsoftware changed the title Fix show bluetooth permission request on startup for iOS Fix request bluetooth permission on startup for iOS Apr 5, 2022
@feelsoftware feelsoftware merged commit 4f0e2c3 into collabree:master Apr 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants