Why are we doing this?
As we begin to support contribution notifications through the iOS app, we need a place for contributors to opt into and out of specific notification types.
Feature job story
As an existing editor I need a way to opt into and out of notifications on my iOS device.
|Logged out||Logged in - Settings||Logged in - Settings > Push Notifications (off)||Logged in - Settings > Push Notifications (on)||Logged in - Settings > Subscriptions|
- No settings related to notifications are shown when a user is logged out
- On log in there are two notifications related settings
- Type subscription (shared with web) is available under Settings > Account > Notification subscriptions
- Push notifications subscriptions are available under Settings > Push notifications
For error states please see https://phabricator.wikimedia.org/T288773
- If notification types are supposed to be toggled OFF by default, then upon login we MUST make a call to options API toggle them all off on the server.
- Handle logout state on this screen. if they want notifications, they have to be logged in.
- Handle "unsuccessfully registered" state on this screen. It could be OS deviceToken generation failed, or PI subscription failed.
- Handle "user denied permissions" state on this screen, with an option to go into settings (if not already).
- Upon load, fetch read options API for the user's primary app language and set current settings (https://www.mediawiki.org/wiki/API:Userinfo)
- Upon first toggle, ask user for permissions if user hasn't authorized yet.
- Then upon toggle of any, set updates via API (https://www.mediawiki.org/wiki/API:Options) for user's primary language. If there was a failure in setting it, show an error and reset toggles to what it was before.
- If user's primary language changes, update the users new primary language settings with the old primary language settings. This will be behind the scenes, if there was an error with this, the read API the next time this screen is loaded will automatically show the server state.
- There's an explore feed card that asks for remote notification permissions, maybe remove this entirely or only if they are logged out.
- Disable current news notification code for now, there is a separate task (https://phabricator.wikimedia.org/T287307) to add back in and test that it still works.
- Heavily test and optimize this screen for accessibility.
Notification Type > API associated value for reading and updating
Talk page message > echo-subscriptions-push-edit-user-talk
Thanks > echo-subscriptions-push-edit-thank
Talk page subscription > echo-subscriptions-push-dt-subscription
Translations > echo-subscriptions-push-cx
Mention > echo-subscriptions-push-mention
Failed mention > echo-subscriptions-push-mention-failure
Successful mention > echo-subscriptions-push-mention-success
Page link > echo-subscriptions-push-article-linked
Connection with Wikidata > echo-subscriptions-push-wikibase-action
Failed login attempts > echo-subscriptions-push-login-fail
Login from an unfamiliar device > echo-subscriptions-push-login-success
Page review > echo-subscriptions-push-page-review
User rights change > echo-subscriptions-push-user-rights
Edit revert > echo-subscriptions-push-reverted
Email from other user > echo-subscriptions-push-emailuser
Edit milestone > echo-subscriptions-push-thank-you-edit