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

onPermissionDenied is called even when the permission was already granted #261

Open
marcus-vinicius-freitas opened this issue Jun 10, 2020 · 2 comments

Comments

@marcus-vinicius-freitas
Copy link

marcus-vinicius-freitas commented Jun 10, 2020

Expected behaviour

I have an app that connects to Google Fit and in order to do that I need the Activity_Recognition permission, I ask it the first time the user connects, and, afterwards if I check it again it should say that the permission was granted.

Actual behaviour

What is actually happening is that If I try to check again the onPermissionDenied will be called.

Steps to reproduce

Call the first time it:

                .withPermission(Manifest.permission.ACTIVITY_RECOGNITION)
                .withListener(CompositePermissionListener(GoogleFitPermissionListener(rootView, activity, onSuccessAction),
                        SnackbarOnDeniedPermissionListener.Builder.with(rootView, activity.getString(R.string.google_fit_data_body, BuildConfig.NAME, BuildConfig.NAME, BuildConfig.NAME))
                                .withOpenSettingsButton(R.string.tracker_disconnect_gf_settings)
                                .build()))
                .check()

and then the second time you check it the onPermissionDenied will becalled, even though the user accepts the first time.

Version of the library

6.2.0

@XBlack97
Copy link

I'm having same issue here to library version 6.2.0

@pedrovgs
Copy link
Contributor

pedrovgs commented Jul 7, 2020

Hi @XBlack97 and @marcus-vinicius-freitas could you please upload a repository with an example reproducing the error mentioned.

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

No branches or pull requests

3 participants