Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement push notification infrastructure #350
There are three issues that discus notifications in some way  , they are mostly about when to send notifications, this issue is about how to send notifications, specifically about sending them via mobile/browser push technologies.
The assumption is that we want them, so this is about how to implement them in the backend.
The main scenario for this is when there is a mobile app, this could be a cordova wrapped web app (like I have done for a POC in the cordova branch in the frontend), or a native app, or other. It doesn't really matter so much from this perspective.
At the moment there is a
So, I would propose to create a new model
As for the technology for push, I think it is a no-brainer to just use Google FCM - see my explanation of it for when I implemented it for trustroots. Note that they later added support for Expo notifications too, which is only needed if you are using Expo for react-native stuff.
When to send a notification? Initial I would just send a push notification on every chat message. There are some potentially fiddly bits around not overwhelming the user with millions of notifications for active chats (like batching up, replacing old notifications with new aggregate ones etc), but given we do not have active chats, I would just do the simple case, 1 message, 1 notification for each participant/pushsubscription.
Other things I would not care about right now are:
Thanks for initiating the discussion on this - the trustroots implementation looks nice and using plain FCM seems like a good choice.
The main reason to separate push notifications from websocket subscriptions is this:
I agree, they should always need explicit agreement from the users. But we can implement this later. A sane default for development would be to implement to all platforms where the user registered (app, web)
You don't want to create a model that contains "sent notifications" yet? Based on:
I agree to just use the python fcm lib instead of fcm-django. We can use some inspirations from django-fcm though.