有没有办法在IOS中接收推送通知有效负载?在安卓中,它的工作原理是这样的:
firebase.messaging().onMessage((message: RemoteMessage) => {
// Process your message as required
});
但是它在iOS中不起作用。它尝试了:
firebase.notifications().displayNotification((notification) => {
console.log(notification);
});
或
firebase.notifications().onNotification((notification) => {
console.log(notification);
});
仍然没有任何效果。谢谢
没关系,我通过这样称呼它来整理它:
firebase.notifications().onNotificationDisplayed((notification: Notification) => {
console.log(notification);
});
firebase.notifications().onNotification((notification: Notification) => {
console.log(notification);
});