Closed adrcotfas closed 6 years ago
Ok, I managed to figure it out: Just don't check for the permission if the user toggled "Don't show again" which is equivalent to !showSnackbar in this case. Thanks for the library!
boolean showSnackbar = true;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
showSnackbar = shouldShowRequestPermissionRationale(Manifest.permission.READ_CONTACTS)
&& checkSelfPermission(Manifest.permission.READ_CONTACTS) == PackageManager.PERMISSION_DENIED;
}
if (showSnackbar)
{
Dexter.withActivity(this)
.withPermission(Manifest.permission.READ_CONTACTS)
.withListener(contactsPermissionListener)
.check();
}
Not actually an issue but a feature proposal:
This may be implemented with the persistence of the isPermanentlyDenied from showPermissionDenied and creating the snackbar according to this but do you have a simpler idea?