Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/197.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React本机Firebase推送通知Android_Android_Firebase_React Native_Firebase Cloud Messaging - Fatal编程技术网

React本机Firebase推送通知Android

React本机Firebase推送通知Android,android,firebase,react-native,firebase-cloud-messaging,Android,Firebase,React Native,Firebase Cloud Messaging,我想在我的react原生项目中使用,但当我想使用参数中的令牌向当前设备发送推送通知(用于测试)时,我遇到了一个问题 我已经从react native fcm测试了示例应用程序,本地通知工作正常,我尝试使用令牌发送,但我不知道为什么,我的设备上没有收到任何消息 这是我的密码 render() { FCM.getFCMToken().then(token => { // token android firebaseClient.sendNotifica

我想在我的react原生项目中使用,但当我想使用参数中的令牌向当前设备发送推送通知(用于测试)时,我遇到了一个问题

我已经从react native fcm测试了示例应用程序,本地通知工作正常,我尝试使用令牌发送,但我不知道为什么,我的设备上没有收到任何消息

这是我的密码

render() {
         FCM.getFCMToken().then(token => { // token android
            firebaseClient.sendNotificationWithData(token)
        });
        //this.showLocalNotification()
        return (
            <Provider store={store}>
                <AppNavigator />
            </Provider>
        );
}
render(){
FCM.getFCMToken().then(token=>{//token)
firebaseClient.sendNotificationWithData(令牌)
});
//this.showLocalNotification()
返回(
);
}
我已经导入了FirebaseClient和PushController


在控制台上,我有一个成功响应,但我没有收到通知。

您检查权限了吗<代码>FCM.requestPermissions() 另外,我有一个问题,我必须添加
“content\u available”:true,
到有效负载