Notification flow
There are two scenarios for using the Navida Pro Push Notification service:
1. Framing the Notifications Messages
The user has given his consent for at least one module (e.g. for the Pension Compass in German VorsorgeKompass). We have few cron-jobs scheduled by module and internal scenario wise. This will get the consent data based on User ID and Module Name and query the business logic parallelly with the consent data received. then this extracted data is used for framing the notification message templates which will be fetched from table (push_notification_msg_config table)
2. Sending push messages
In the first step, push messages are sent only from the backend. All the push notification creation is handled in the cron job microservice, different jobs are provided for each module like Vorsorgekompas, Challenges, Video Consultation etc. Once notification messages are created the notification service will pick this up and sent to Wonderpush based on the priority. For example, the backend Pension Compass has a cron-job module in the cron-service microservice, considering the "VORSORGE_NO_PLAN" that checks every morning 4:05 AM. If a user is found and satisfy the business logic this will create the message with a scheduled sending time called date_planned which is for upcoming Tuesday and push it to Db and to Table "navida_push_notification_msg" table. Then we have some other service called notification-service which is again another cron-job which runs every 5 to 10 mins and look for waiting messages in the above table and based on the priority for the message it will prioritize the message which need to send first and also look for consent and expiration date before send the message to the wonder push client which will eventually push to user devices.
Database schema (ER diagram)
Push notification consent
The user need to provide consent to recieve the push notifications. After login , the user will be presented with a generic popup to get a consent on push notification which will inturn enabled the wonderopush SDK and will create a wonderpush device Id which will identify this user. By giving this consent , all the feature specific consents will also be get