首先关闭应用程序:
this.notificationOpenedListener = firebase.notifications()
.getInitialNotification()
.then((notificationOpen: NotificationOpen) => {
if (notificationOpen) {
// App was opened by a notification
// Get the action triggered by the notification being opened
const action = notificationOpen.action;
// Get information about the notification that was opened
const notification: Notification = notificationOpen.notification;
}
});
如果应用程序在后台运行,则秒:
this.notificationOpenedListener = firebase.notifications()
.onNotificationOpened((notificationOpen: NotificationOpen) => {
// Get the action triggered by the notification being opened
const action = notificationOpen.action;
// Get information about the notification that was opened
const notification: Notification = notificationOpen.notification;
});
如何首先和第二次连接代码。
引用:a link!
还是如何鞭打关闭或在后台运行的应用程序本机?