From e60b56a0b05880837e080b76909ebb9f8d322aed Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Thu, 7 Sep 2023 18:04:00 +0800 Subject: [PATCH] Added notification dialog workflow description --- web-push.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/web-push.md b/web-push.md index 2415033..a7b3c53 100644 --- a/web-push.md +++ b/web-push.md @@ -358,3 +358,32 @@ unsubscribeFromPush().catch((err) => { ``` NOTE: We could offer an option within the app to "mute" these notifications. This wouldn't turn off the notifications at the browser level, but you could make it so that your Service Worker doesn't display them even if it receives them. + + +## NOTIFICATION DIALOG WORKFLOW + +# ON APP FIRST-LAUNCH: +The user is periodically presented with the notification permission dialog that asks them if they want to turn on notifications. User is given 3 choices: + +- "Turn on Notifications": triggers the browser's own notification permission prompt. +- "Maybe Later": dismisses the dialog, to reappear at a later instance. (The next time the user launches the app? After X amount of days? A combination of both?) +- "Never": dismisses the dialog; app remembers to not automatically present the dialog again. + +# IF THE USER CHOOSES "NEVER": +The dialog can still be accessed via the Notifications toggle switch in `AccountViewView` (which also tells the user if notifications are turned on or off). + +# TO TEMPORARILY MUTE NOTIFICATIONS: +While notifications are turned on, the user can tap on the Mute Notifications toggle switch in `AccountViewView` (visible only when notifications are turned on) to trigger the Mute Notifications Dialog. User is given the following choices: + +- Several "Mute for X Hour/s" buttons to temporarily mute notifications. +- "Mute until I turn it back on" button to indefinitely mute notifications. +- "Cancel" to make no changes and dismiss the dialog. + +# TO UNMUTE NOTIFICATIONS: +Simply tap on the Mute Notifications toggle switch in `AccountViewView` to immediately unmute notifications. No dialog needed. + +# TO TURN OFF NOTIFICATIONS: +While notifications are turned on, the user can tap on the App Notifications toggle switch in `AccountViewView` to trigger the Turn Off Notifications Dialog. User is given the following choices: + +- "Turn off Notifications" to fully turn them off (which means the user will need to go through the dialogs agains to turn them back on). +- "Leave it On" to make no changes and dismiss the dialog. \ No newline at end of file