-
Notifications
You must be signed in to change notification settings - Fork 237
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
Defer setting up notifications until user has logged in #324
Comments
In case it's convenient, I think it's probably possible to keep much of the initialization logic—in particular, obtaining the relevant APNs or FCM token—where it is in #122 (at startup), on modern Android and iOS, while still postponing the permissions prompt to be done at first login or wherever is appropriate.
|
Cool, thanks for that investigation. |
Obtaining the token at startup has some advantages I think:
|
I think this is unlikely. As a user I'd definitely find that particular example annoying, and I can't think of any other such use cases.
If you have a logged-in account, then by my original spec above we'd initialize notifications (including getting the token) immediately on launch.
This is an interesting point. I'm not sure. |
Probably more important than whether we always get the token on startup or not is: whatever we choose, let's see if we can avoid a situation like zulip/zulip-mobile#5329. 😄 |
Seems like this wasn't totally successful in the initial version: We do get the token right at startup, and then send it to a server upon logging in, but at least on Android we never get permission to actually show notifications, and so when a notification arrives we don't actually succeed in showing it. When fixing that, I'll see if it's straightforward to defer the notification permission prompt until logging in, as this issue calls for; if not, I might leave this issue for later. |
In my initial implementation of notifications (#122), I think for simplicity I'll have it go ahead and initialize the notifications infrastructure as soon as the app is launched: find out the registration token, and listen for incoming notification messages.
This is likely to produce an off-putting UX at onboarding time, though: it's likely to cause a permissions prompt, asking the user to give us permission to show notifications, first thing before they've had any other interaction with the app.
So we should fix it so that we instead do the setup only once the user is actually logged into a Zulip account. That means:
The text was updated successfully, but these errors were encountered: