woodemi / quick.flutter

53 stars 62 forks source link

Delay Bluetooth permission prompt on iOS until it is really needed #26

Closed fotiDim closed 2 years ago

fotiDim commented 2 years ago

This change delays Bluetooth permission prompt on iOS until it is really needed. It is needed to make apps conform to Apple's HIG. You can test it if you remove:

            FutureBuilder(
              future: QuickBlue.isBluetoothAvailable(),
              builder: (context, snapshot) {
                var available = snapshot.data?.toString() ?? '...';
                return Text('Bluetooth init: $available');
              },
            ),

from the example app. You will only get the permission prompt when you tap on startScan.