-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
android: targetSdkVersion to 33, this time handling new notifs permission #5761
android: targetSdkVersion to 33, this time handling new notifs permission #5761
Conversation
Thanks for taking care of this! This implementation looks good to me. I also tested on my Android 13 phone, in order to see specifically the experience on upgrading an existing install (that had already had notification permission). The result was:
Merging. |
…sion We bumped this to 33 in 6f44474 / v27.210, but then reverted it in 2e196e4 because of zulip#5753, "Use the new POST_NOTIFICATIONS runtime permission on Android". Bump it again, this time with a fix for that issue: we declare the new permission and add a runtime function call to request it in context. For users, this means: - If on iOS: No change. - If below Android 13: No change. A permission request follows the creation of a notification channel, so effectively it happens on app startup: https://developer.android.com/develop/ui/views/notifications/notification-permission#new-apps - For a new app install on Android 13, the permission will now be requested in context instead of at startup: https://developer.android.com/develop/ui/views/notifications/notification-permission#new-apps - For existing app installations when Android is upgraded to 13 or later, the permission should automatically be granted without a prompt as long as notifications hadn't been explicitly disabled before the upgrade. This should still work across a "backup and restore": https://developer.android.com/develop/ui/views/notifications/notification-permission#existing-apps (However: we are tracking zulip#5484 as an unrelated cause of notifications breaking across a "backup and restore".) If RN and Android decide it's helpful, a "rationale" is shown to the user just before the new in-context permission request. That's a modal showing a message we provide (see added code), with an OK button to close the modal and proceed to Android's plain Yes/No dialog for the permission request. Fixes: zulip#5753
a44f580
to
4fe472c
Compare
Interesting! That's not actually what I would expect. I'd expect that notifications would "just work" in your case, without the prompt showing up, because you should have been "pre-granted" as described in the doc:
—Er, actually, reading that again, it's about upgrading to Android 13, which isn't what you did… 🤷 Anyway, not much harm in having to tap "Allow" even if you've already done it ages ago. |
Tested on an emulated Android Pixel XL running Android 13, and on the office Android device (Samsung Galaxy S9 running Android 9).
Screen recording of the "rationale" modal coming soon.
(edit: just added the
Fixes: #5453
line to the PR description, which I forgot, oops)Fixes: #5753
Fixes: #5453