Есть ли способ захвата уведомлений, полученных на мобильный, с помощью плагина Ionic или Cordova?
import { FCM } from '@ionic-native/fcm/ngx'; constructor(private fcm: FCM) {} ... this.fcm.subscribeToTopic('marketing'); this.fcm.getToken().then(token => { backend.registerToken(token); }); this.fcm.onNotification().subscribe(data => { if(data.wasTapped){ console.log("Received in background"); } else { console.log("Received in foreground"); }; }); this.fcm.onTokenRefresh().subscribe(token => { backend.registerToken(token); }); this.fcm.unsubscribeFromTopic('marketing');
PS Подробная процедура здесь: https://ionicframework.com/docs/native/fcm