Как улучшить процесс push-уведомления в Django PWA?

Я учусь делать push-уведомления в Django PWA -app. Я решил использовать библиотеку fcm-django для работы в back end и Firebase Cloud Messaging в качестве push-сервиса. Я не уверен в процессе и в том, правильно ли я все делаю. Вот как я представляю себе построение процесса, пожалуйста, поправьте меня, если что-то не так. Пожалуйста, также обратите внимание, что я больше работаю с back end и не так много знаю о front end стороне:

  1. Get permission from the user for the notifications in front end (service worker). This is the JS -library I think I'll use for the front end job
  2. If we got the permission: Get the token in the front end and save it to the database with device and user info. For this I first thought I'd need to build some custom view in my Django back end, but researching more revealed that I can use fcm-django built in classes like FCMDeviceViewSet and FCMDeviceAuthorizedViewSet.
  3. Send push messages to the user. This will include custom views and logic in the back end to get the users and send the notifications to them when some criteria is met (for example datetime).

Буду очень признателен за отзывы и предложения, если я что-то неправильно понял или забыл, или процесс можно сделать каким-то лучшим образом.

Вернуться на верх