A client reported that his activity onPause and onResume are getting executed when the Push Pre-Permission inapp is triggered even if the permission has been declined twice in a row.
The cause of the issue is the code that is requesting the permission, because the Leanplum SDK doesn't know whether the permission has been declined, neither the Android SDK provides such method. The only possible solution is to ask the user for input on his onRequestPermissionResult.
If user dismisses the native dialog without clicking Allow or Don't Allow button the system will return PERMISSION_DENIED in the onRequestPermissionResult.
User can call PushPermissionUtilKt.onRequestPermissionResult from his implementation of onRequestPermissionResult to give feedback in the SDK. He can also reset the declineCounter or directly set it as 2 to disable the permission request.
Background
A client reported that his activity
onPause
andonResume
are getting executed when thePush Pre-Permission
inapp is triggered even if the permission has been declined twice in a row. The cause of the issue is the code that is requesting the permission, because the Leanplum SDK doesn't know whether the permission has been declined, neither the Android SDK provides such method. The only possible solution is to ask the user for input on hisonRequestPermissionResult
.If user dismisses the native dialog without clicking
Allow
orDon't Allow
button the system will returnPERMISSION_DENIED
in theonRequestPermissionResult
.User can call
PushPermissionUtilKt.onRequestPermissionResult
from his implementation ofonRequestPermissionResult
to give feedback in the SDK. He can also reset thedeclineCounter
or directly set it as2
to disable the permission request.