You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 5, 2021. It is now read-only.
Calling await LocationPermissions().requestPermissions(); with both "Fine" and "Coarse" permission in AndroidManifest.xml gives the Can request only one set of permissions at a time. in the logs. Also, giving PermissionStatus.denied (even if approved) when checkPermissions called after awaiting requestPermissions.
Expected behaviour
The error/warning should not come in and correct status should be returned by checkPermissions after requestPermissions is called.
Reproduction steps
Code to reproduce:
Future<bool> _checkLocationPermission() async {
final checkPermission =awaitLocationPermissions().checkPermissionStatus();
printIfDebug("checkPermission: $checkPermission");
if (checkPermission ==PermissionStatus.granted ||
checkPermission ==PermissionStatus.restricted) returntrue;
returnfalse;
}
Future<bool> _checkAndRequestLocationPermission() async {
// return true, if already have permissionif (await_checkLocationPermission()) returntrue;
// request permissionfinal _ =awaitLocationPermissions().requestPermissions();
printIfDebug("requestPermission: $_");
// check if permission was givenfinal hasPermission =await_checkLocationPermission();
// if no permission and "showShowPermissionRationale" then go to settings and return falseif (!hasPermission &&awaitLocationPermissions().shouldShowRequestPermissionRationale()) {
// if shouldRequest false, then open app settings and return false// TODO UI that shows why this permission is requiredawaitLocationPermissions().openAppSettings();
returnfalse;
}
return hasPermission;
}
This is how it it is used for checking access for location before calling WifiManager.startScan api on android
Future<List<WifiNetwork>> scanWifi() async {
if (await_checkAndRequestLocationPermission())
returnawaitWiFiForIoTPlugin.loadWifiList();
returnnull;
}
🐛 Bug Report
Calling
await LocationPermissions().requestPermissions();with both "Fine" and "Coarse" permission inAndroidManifest.xmlgives theCan request only one set of permissions at a time.in the logs. Also, givingPermissionStatus.denied(even if approved) whencheckPermissionscalled after awaitingrequestPermissions.Expected behaviour
The error/warning should not come in and correct status should be returned by
checkPermissionsafterrequestPermissionsis called.Reproduction steps
Code to reproduce:
This is how it it is used for checking access for location before calling
WifiManager.startScanapi on androidConfiguration
Android SDK: 28
Version:
^3.0.0Platform: