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.
- Add push capability/entitlements in project.
- Ask UNNotifications framework to registerForRemoteNotifications in AppDelegate's didFinishLaunching.
- In UNUserNotificationCenterDelegate callbacks, remember device token or failure in some form in memory, it will be used in the next step.
- 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.
- 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