Notifications

Push Notifications Initialization

When starting the application, initialize push notifications src/helpers/notifications.helper.ts initNotifications

  • request user permission to receive push notifications

  • subscribe to app opening events via notification: getInitialNotification, onNotificationOpenedApp

  • if permission to receive push notifications is not granted, unsubscribe unsubscribeFromPushWorker

Push Notifications Subscription

src/store/actions/settings.actions.ts subscribeToPushWorker

  • check notification reception permission

  • execute request /gateway/alfresco/alfresco/s/citeck/global-properties?name=ecos.server.tenant.id

  • get FCM token

  • send the obtained token and Tenant ID to the server in the request /gateway/api/records/mutate

  • subscription ID received in the response is saved in local storage for token updates, push notifications unsubscription

Note

When subscribing to push notifications, the application locale locale is additionally sent

Token Update

src/store/actions/settings.actions.ts onTokenRefresh, sendLanguageSettings

  • When updating the FCM token, it must be sent in the request /gateway/api/records/mutate with the subscription ID specified

Note

When updating the token and changing the application interface language, the application locale locale is additionally sent

Push Notifications Unsubscription

src/store/actions/settings.actions.ts unsubscribeFromPush

  • execute request /gateway/api/records/delete, specifying the subscription ID obtained during the notification subscription step

Opening Push Notifications

src/helpers/notifications.helper.ts getInitialNotification, onNotificationOpenedApp

When opening a task from a notification, the taskId passed in the notification payload is important