我刚刚安装了 react-native-firebase v4.0,我试图检测何时有人打开了我从谷歌控制台发送的通知。
但是当我将文档中的示例放入我的代码中时,我得到了
解析错误:意外令牌,预期:(致命)
在“行动”
我在这里想念什么?我以前从未使用过这种语法。
componentDidMount() {
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;
});
}