【发布时间】:2017-12-18 05:07:32
【问题描述】:
我想在我的 react-native 项目中使用react-native-fcm,当我想在参数中使用令牌向我当前的设备(用于测试)发送推送通知时遇到问题。
我已经从 react-native-fcm 测试了示例应用程序,本地通知工作正常,我尝试使用令牌发送,但我不知道为什么,我的设备上什么也没收到。
这是我的代码
render() {
FCM.getFCMToken().then(token => { // token android
firebaseClient.sendNotificationWithData(token)
});
//this.showLocalNotification()
return (
<Provider store={store}>
<AppNavigator />
</Provider>
);
}
我已经导入了 FirebaseClient 和 PushController
在控制台我有一个成功响应,但我没有收到通知。
【问题讨论】:
标签: android firebase react-native firebase-cloud-messaging