permission icon indicating copy to clipboard operation
permission copied to clipboard

Inconsistent permission status behaviour

Open JamesMcIntosh opened this issue 5 years ago • 5 comments

When you request multiple permission statuses it looks like you can get different results than querying individually as PermissionStatus.whenInUse and PermissionStatus.always are not handled in the getPermissionsStatus(List<PermissionName> permissionNameList) case statement. They default to PermissionStatus.notDecided

see: https://github.com/once10301/permission/blob/master/lib/permission.dart#L14

JamesMcIntosh avatar Feb 06 '19 05:02 JamesMcIntosh

Describe your problem in detail?

once10301 avatar Jun 05 '19 03:06 once10301

Ah I see, getSinglePermissionStatus is for iOS and getPermissionStatus is for Android. This is VERY confusing and not obvious looking at the method signatures, I would recommend either:

  • Implement both methods on each system.
  • return a different enum if you actually wish to distinguish between the two types

JamesMcIntosh avatar Jun 05 '19 03:06 JamesMcIntosh

We can request permissions together when the user opens the app for the first time on Android, but we can only request single permission on iOS.

once10301 avatar Jun 05 '19 04:06 once10301

That makes sense as to why you took that approach, if you pass through an array of permissions into the iOS code you should be able to iterate them and accumulate the results to return back in one call.

JamesMcIntosh avatar Jun 05 '19 05:06 JamesMcIntosh

I am an Android developer, it is difficult for me. ^_^

once10301 avatar Jun 05 '19 05:06 once10301