Ejemplo: tutorial de permisos de concesión del complemento iónico 5 “firebasex”
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}`));
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)