Main part
Push notifications (PN) functionality based on the Firebase Cloud Service (FCM) is planned to be added. Flow which is needed to be implemented:
Mobile app sends device token to the server.
Server stores
devices_token
in to DB. One user can have severaldevice_token
s.On the specific events a PN should be sent for specific user for each their
device_token
.User receives the PN on their device.
PN functionality is planned to be implemented in edx-platform and edx-ace repositories.
edx-platform
will contain all required environmental variables that is needed to authenticate our platform with FCM to be able to send authenticated requests to FCM service to send push notifications.edx-ace
is planned to be extended by:Extending Recipient to have additional
device_token
field.Add
PushNotificationChannel
, similar to other channels in theedx-ace
Add
PushNotificationRenderer
, similar toEmailRenderer
but for PN.Use django-push-notifications OR firebase-admin-python.
django-push-notifications
contains all required modules like models, views, serializers and urls for adding
device_token
into the systeminitialization using credentials from FCM
the plan is to incapsulate functionality from the package into the
edx-ace
(reexport)
firebase-admin-python (in case django-push-notifications won’t work for us)
requires to implement initialization, models, serializer, url and additional functionality that is implemented by django-push-notifications
Integration of incapsulated Push Notifications functionality from the
edx-ace
intoedx-platform
Extend
INSTALLED_APPS
withdjango-push-notifications
that is planned to be defined in theedx-ace
Extend urls for POST
device_token
endpointUse similar way to send PN as already done for Emails from
edx-ace
Problems & Questions
django-push-notifications is not supported currently for Python 3.10 and Django 4? Do we want to contribute this package or to use Firebase admin SDK.
Findings: The current package isn’t fully compatible wuth
Where the push notifications app should be initialized? Example: we specify
FCM_API_KEY
and initialization should be in theedx-ace
or in theedx-platform
.In case we use django-push-notifications, what is the best way to extend
INSTALLED_APPS
? Install it straight intoedx-platform
or onlyedx-ace
?If we don’t use django-push-notifications can we create models and endpoint in the
edx-ace
New questions & updates (2024.04.09):
We start implementing the solution with
edx-ace
right now.edx-ace
Push Notifications will be imported and used underlms/djangoapps/mobile_api
Do we want to implement user preferences? In the notifications app in
edx-platform
there is preferences system.