Answers for "ionic 5 "firebasex" plugin grant Permission tutorial"

0

ionic 5 "firebasex" plugin grant Permission tutorial

import { FirebaseX } from '@ionic-native/firebase-x/ngx';


constructor(private firebaseX: FirebaseX) { }

...


this.firebaseX.getToken()
  .then(token => console.log(`The token is ${token}`)) // save the token server-side and use it to push notifications to this device
  .catch(error => console.error('Error getting token', error));

this.firebaseX.onMessageReceived()
  .subscribe(data => console.log(`User opened a notification ${data}`));

this.firebaseX.onTokenRefresh()
  .subscribe((token: string) => console.log(`Got a new token ${token}`));
Posted by: Guest on November-30-2020

Code answers related to "ionic 5 "firebasex" plugin grant Permission tutorial"

Browse Popular Code Answers by Language