Messaging Service - AparanjVenkat/PushNotifications GitHub Wiki

ng g service messaging

The messaging service will obtain the user’s permission to send push notifications and listen for any incoming messages.

  1. Get Permission from the User getPermission() - All browsers/devices will ask for the user’s explicit permission to receive push messages from an app. After the user confirms, Firebase will return a token that we can reference to start sending messages.

  2. Save FCM Token in Firebase updateToken() - Whenever you send messages to a user you must reference this token, so we are going to save it in the firebase database database. This token can change for a variety of reasons, such as clearing the browser cache, so we need to update