简体   繁体   English

反应原生 | Firebase 消息

[英]React Native | Firebase Messaging

I am using firebase push notifications in my React native project.我在我的 React 本机项目中使用 firebase 推送通知。 With the recent update (11.5.0), the application was no longer functional due to the changed functions.在最近的更新 (11.5.0) 中,由于功能更改,该应用程序不再起作用。 I also upgraded to 11.5.0.我也升级到 11.5.0。 With the code I wrote below, it gives the following error on Android when buying FCM Token on IOS.使用我在下面编写的代码,在 IOS 上购买 FCM 令牌时,它会在 Android 上出现以下错误。 What is the solution?解决办法是什么?

package.json

"@react-native-firebase/app": "^11.5.0",
"@react-native-firebase/messaging": "^11.5.0",
"react-native-push-notification": "^7.3.1",

import messaging from '@react-native-firebase/messaging';

const fcmToken = await messaging().getToken()
console.log('fcm token ', fcmToken);

错误

Try add firebaseMessagingVersion = 21.1.0 in buildscript of your app/build.gradle file尝试在 app/build.gradle 文件的buildscript中添加firebaseMessagingVersion = 21.1.0

buildscript {
  ext {
    ....
    firebaseMessagingVersion = "21.1.0"
  }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 React Native 中获取 Firebase Cloud Messaging 令牌 - Getting Firebase Cloud Messaging token in React Native React Native / Firebase Messaging-从不发送消息/通知 - React Native / Firebase Messaging - messages/notifications are never sent > 任务:@react-native-firebase_messaging:compileDebugJavaWithJavac FAILED - > Task :@react-native-firebase_messaging:compileDebugJavaWithJavac FAILED 无法使用Firebase Messaging编译React本机应用程序? - Can't Compile React native App with Firebase Messaging? 在 Firebase 云消息传递中,React 本机应用程序未通过 TOPIC 接收通知 - React native app not receiving notifications via TOPIC in Firebase cloud messaging 如何解决 React Native Firebase 错误 (messaging().getToken()),与 react-native-device-info 相关 - How to resolve React Native Firebase Error (messaging().getToken()), related to react-native-device-info 有没有人使用 react-native-push-notification 和 firebase 云消息设置推送通知? [等候接听] - Has anyone setup Push notifications using react-native-push-notification and firebase cloud messaging? [on hold] 云消息传递如何在 react-native-firebase v6.xx 中工作? - How Cloud Messaging Works in react-native-firebase v6.x.x? 使用@react-native-firebase/messaging 收到通知后应用程序崩溃 - App crashes after receiving notification using @react-native-firebase/messaging 如何使用 react-native-firebase/messaging(FCM) 从栏点击通知后将应用程序打开到特定页面? - How to open app to specific page after click notification from bar by using react-native-firebase/messaging(FCM)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM