Karumi/Dexter

onPermissionDenied is called even when the permission was already granted

オープン

#261 opened on 2020/06/10

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)Java (682 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (5,224 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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

コントリビューターガイド