import { FirebaseX } from '@awesome-cordova-plugins/firebase-x/ngx';
constructor(private firebaseX: FirebaseX) { }
...
this.firebaseX.getToken()
.then(token => console.log(`The token is ${token}`))
.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}`));