===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.
===Design
|{F34391795 width=220}
| [[ https://www.figma.com/file/cedgOU5CyOR0UVqtjDOvzE/iOS-Notifications?node-id=305%3A9 | Figma link ]]
The text in 'Learn more about notifications' will need to be updated by folks who better understand the technical updates to the new notification system, I simply copied this over from what is currently available in the app.
===Information architecture
Notification settings should appear in the same place as they do currently Settings > Notifications
===Design needs
- Error state for push notification subscription failure
===Development Notes
To read notification preferences: https://www.mediawiki.org/wiki/API:Userinfo
To update notification preferences: https://www.mediawiki.org/wiki/API:Options
- 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 (TBD link) to add back in and test that it still works.