Dexter icon indicating copy to clipboard operation
Dexter copied to clipboard

onPermissionDenied called twice if decline access to permission

Open gromiloff opened this issue 8 years ago • 1 comments

Expected behaviour

onPermissionDenied(PermissionDeniedResponse response) must called one time

Actual behaviour

onPermissionDenied(PermissionDeniedResponse response) called twice

Steps to reproduce

  1. Dexter.withActivity(this) .withPermission(Manifest.permission.ACCESS_FINE_LOCATION) .withListener(this) .withErrorListener(this) .check();

  2. on start first activity after install app - decline access

  3. restart application (full stop and start again). Next time decline again with set flag no ask again

Version of the library

4.0.0 / 4.1.1

gromiloff avatar Sep 11 '17 13:09 gromiloff

Hi @gromiloff

Where are you asking for permissions? If it's on the onResume method I'd say your problem is there, keep in mind that when the permission has been denied, we need to launch an invisible activity to ask the system for the real state of the permission status so it might re-trigger the onResume method of your activity.

If you send us more context on how are you using Dexter we can better help you find the issue here.

Thanks for reporting.

Serchinastico avatar Sep 20 '17 09:09 Serchinastico