You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor: Implement runtime notification permission for Android 13+
This commit introduces runtime permission handling for notifications, a requirement for apps targeting Android 13 (API level 33) and higher.
Key changes:
- Added new string resources for notification permission dialog.
- Created ADB shell scripts to grant, revoke, and clear notification permissions for testing purposes.
- Updated `MainService.kt` to check for `POST_NOTIFICATIONS` permission before attempting to show or update a notification on Android 13+.
- Modified `MainActivity.kt` to:
- Request the `POST_NOTIFICATIONS` permission at runtime.
- Provide an educational UI to explain why the permission is needed if the user initially denies it or has previously denied it.
- Offer a shortcut to the app's settings screen for the user to grant the permission.
- Increased Gradle JVM arguments for improved build performance.
# The user manually disables notifications when the app is installed on a device that runs 12L or lower, then the device upgrades to Android 13 or higher:
<stringname="notification_permission_message">This app needs notification permission to show game progress when you leave the app. You can grant this permission in the app\'s settings.</string>
0 commit comments