Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing askNotificationPermission to avoid infinite loop between PolicyManagementActivity and GrantPermissionsActivity #228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

techsouravganguly
Copy link

Issue #227 was raised regarding NotificationPermission not displaying after a dangerous permission is rejected twice. Upon analysis, the flow led to an infinite loop where PolicyManagementActivity repeatedly called askNotificationPermission on resume.

New Flow after Changes:

  • PolicyManagementActivity.onResume -> askNotificationPermission
  • Check if the permission is denied twice using shouldShowRequestPermissionRationale
  • If not, request permission directly.
  • If denied twice, show a Snackbar to enable it from settings.

@techsouravganguly techsouravganguly force-pushed the Fix-askNotificationPermission branch from 0ebb606 to fdeae76 Compare October 7, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant