Setup push notification in the app.
Closed this issue · 2 comments
rotimi-best commented
Setup push notification in the app.
rotimi-best commented
This commit 56c9acd was what allowed me get a push notification both on mobile and desktop.
Findings
- A user might not get the push notification prompt because their setting refuses push notification.
- Writing a custom service worker was enough to allow the push notification. (might need future work on this)
Push flow
- User sign's up
- We show message asking for push.
- We trigger prompt message if user agrees and cancel if user clicks cancel (should be recorded in google analytics)
- We send the subscription data with the
userId
to the server. - On the server side we
push
into the subscriptions array of the user.
TODO
- Implement above flow and save the subscription in the db
- Save the user's email and other information on the server.
- Listen for unsubscription in serviceWorker
rotimi-best commented
All the Todo listed below has been done.
-
Implement above flow and save the subscription in the db
-
Save the user's email and other information on the server.
-
Listen for unsubscription in serviceWorker