繁体   English   中英

应用消息中的 Firebase 在我的 React Native 项目中不起作用。 有人有同样的问题吗?

[英]Firebase in app messaging is not working in my react native project. Anyone having the same issue?

我收到推送通知消息没有任何问题,但我在应用程序消息中遇到问题,我的 firebase 版本如下enter image description here我根据文档完成了所有安装。但我不知道为什么它不工作反应本机版本 0.64.4

我尝试安装最新版本的 firebase 还是不行

package.json

 "@react-native-firebase/analytics": "14.0.0", "@react-native-firebase/app": "14.0.0", "@react-native-firebase/crashlytics": "14.0.0", "@react-native-firebase/in-app-messaging": "14.0.0", "@react-native-firebase/messaging": "14.0.0"
在我的应用程序 js 文件中,代码是这样的
 async()=> { async function bootstrap() { await firebase.inAppMessaging().setMessagesDisplaySuppressed(true); } async function onSetup(user) { await setupUser(user); firebase.inAppMessaging().setMessagesDisplaySuppressed(false); } await bootstrap(); await onSetup(); }

可能你需要使用这个 package https://github.com/invertase/react-native-firebase/tree/main/packages/in-app-messaging

使用示例如下:

https://rnfirebase.io/in-app-messaging/usage#main

也请使用版本 ^16 的库 Firebase

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM