once10301 / permission

Other
66 stars 58 forks source link

Permissions not being enabled eventhough permission status says PermissionStatus.allow #18

Open fritz-playmaker opened 5 years ago

fritz-playmaker commented 5 years ago

I am successfully requesting permission for Storage ad Microphone and my log indicates that permissions are allowed. But the moment i attempt to record an audio, the app crashes indicating that the Permissions have not been granted. After running the app 2 to 3 times, the permissions finally gets enabled. Great library but not reliable at the moment. Android manifest has the permissions inserted also.

Log Indicating Successful activation of Permissions

I/flutter (27786): PermissionName.Microphone: PermissionStatus.allow
I/flutter (27786): PermissionName.Storage: PermissionStatus.allow

Error Log when trying to record an audio

E/flutter (27786): Exception: PlatformException(FlutterSoundPlugin, NO PERMISSION GRANTED, android.permission.RECORD_AUDIO or android.permission.WRITE_EXTERNAL_STORAGE)

Android Manifest Permissions

   <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.LOCATION"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO" />

Code for requesting Permissions

 Map<PermissionGroup, PermissionStatus> permissions = await PermissionHandler()
        .requestPermissions([
      PermissionGroup.storage,
      PermissionGroup.speech,
      PermissionGroup.camera,
      PermissionGroup.location
    ]);
    print(permissions.toString());
  }
gumulka commented 5 years ago

I have the same issue. Wanting write permission on external storage, but only getting read permission.

I believe it is because request https://github.com/once10301/permission/blob/bf87116cb1fe7688e9c7d78ba324c887be3fe0db/android/src/main/java/com/ly/permission/PermissionPlugin.java#L80-L87 asks only the the permissions given by getManifestPermission which is https://github.com/once10301/permission/blob/bf87116cb1fe7688e9c7d78ba324c887be3fe0db/android/src/main/java/com/ly/permission/PermissionPlugin.java#L125

rdcoder33 commented 5 years ago

I have the same issue. Wanting write permission on external storage, but only getting read permission.

I believe it is because request

https://github.com/once10301/permission/blob/bf87116cb1fe7688e9c7d78ba324c887be3fe0db/android/src/main/java/com/ly/permission/PermissionPlugin.java#L80-L87

asks only the the permissions given by getManifestPermission which is https://github.com/once10301/permission/blob/bf87116cb1fe7688e9c7d78ba324c887be3fe0db/android/src/main/java/com/ly/permission/PermissionPlugin.java#L125

How can I edit this file to make WRITE_EXTERNAL_STORAGE?

oversuperman commented 5 years ago

I have the same issue.I request record permission and in setting is open.Then I need close the permission and open again by my hand to make it work.