-
Notifications
You must be signed in to change notification settings - Fork 309
notif: Support iOS! #409
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
notif: Support iOS! #409
Conversation
This is one of the steps required for showing push notifications, as helpfully laid out here: https://firebase.flutter.dev/docs/messaging/apple-integration/
This is one of the steps required for showing push notifications (when the app isn't already running, anyway), as helpfully laid out here: https://firebase.flutter.dev/docs/messaging/apple-integration/
Fixes: zulip#321
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good! Merging. I agree with one of your TODOs that it would eventually be nice not to have to think about Firebase when reading iOS-notification code. But this seems fine for now.
/// These values are similar to [kFirebaseOptionsAndroid] but are for iOS, | ||
/// and they let us initialize the Firebase library so that we can do that. | ||
/// | ||
/// TODO: Cut out Firebase for APNs and use a thinner platform-API binding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// TODO: Cut out Firebase for APNs and use a thinner platform-API binding.
Oh good, I think this might be wise to do eventually. 🙂
Fixes #321.
There's one notable limitation in the functionality here, which I've filed as:
Also the permissions prompt comes annoyingly early:
We can fix those in the Beta 2 period.
I've manually tested this with my own Zulip dev server (running main), and it works. Testing notifications with a dev version of the client is kind of a pain, unfortunately (even after the simplifications I made to it this month):
https://github.com/zulip/zulip-mobile/blob/main/docs/howto/push-notifications.md#ios
so for review, given the impending Beta 1, I think it's best to skip that for now — for manual testing we can just rely on what I've done already, and on the next alpha release.
Screenshot of the notifications in Notification Center:
(There were also messages with content "4", "2", and "0". They didn't produce notifications because of #408 -- the app was open in the foreground at the time.)
(The icon needs to be replaced; that's #390.)