You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AparanjVenkat edited this page May 22, 2018
·
1 revision
ng g service messaging
The messaging service will obtain the user’s permission to send push notifications and listen for any incoming messages.
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.
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