[英]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.