Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

onPermissionDenied called twice if decline access to permission #183

Open
gromiloff opened this issue Sep 11, 2017 · 1 comment
Open

onPermissionDenied called twice if decline access to permission #183

gromiloff opened this issue Sep 11, 2017 · 1 comment

Comments

@gromiloff
Copy link

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

@Serchinastico
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants