Page MenuHomePhabricator

Build out push subscription and registration flow
Closed, ResolvedPublic

Description

Note a full end-to-end setup is blocked on https://phabricator.wikimedia.org/T285417, but in the meantime we can trigger pushes manually at https://ios-playground.wmflabs.org/push/.

This encompases the development for these tasks.

  1. Add push capability/entitlements in project.
  2. Ask UNNotifications framework to registerForRemoteNotifications in AppDelegate's didFinishLaunching.
  3. In UNUserNotificationCenterDelegate callbacks, remember device token or failure in some form in memory, it will be used in the next step.
  4. Tweak notification settings screen to only have a single toggle to enable or disable permissions. Handle case where user is not logged in, OS registration in step 2 failed, or permissions are in denied state. This screen will likely be tweaked further in https://phabricator.wikimedia.org/T271855, this is just to get end-to-end working.
  5. When permissions are allowed in step 4, register device token with PI registration service (https://en.wikipedia.org/w/api.php?action=help&modules=echopushsubscriptions, create command). Handle failure in Notification Settings UI.

Useful documentation:
https://developer.apple.com/documentation/usernotifications/registering_your_app_with_apns
https://developer.apple.com/documentation/usernotifications/asking_permission_to_use_notifications
https://www.mediawiki.org/wiki/Wikimedia_Product_Infrastructure_team/Push_Notifications_Infrastructure
https://wikitech.wikimedia.org/wiki/Push_notifications
https://www.mediawiki.org/wiki/Notifications/Developer_guide/Push#Subscription_registration

Event Timeline

LGoto triaged this task as Medium priority.Jul 26 2021, 6:42 PM
Tsevener updated the task description. (Show Details)

Updated steps to reduce scope on this to keep PR small and purely foundational, to get a happy path end-to-end in place. Settings screen will be completed in https://phabricator.wikimedia.org/T288688.

Nothing very surface level to test here, so moving into PM signoff. QA will touch it when they get more into the specific tickets with push notification mocks.