【发布时间】:2021-08-04 04:31:46
【问题描述】:
我有一个 React Native 项目,希望能够接收来自 FCM 的通知。我已经设置了项目(为我的项目生成了一个 google-services.json 文件,相应地修改了 build.gradle 文件等),但到目前为止我还无法运行该项目。我正在使用 React Native Firebase 库https://rnfirebase.io/,但到目前为止体验并不好。我一直在错误中跌跌撞撞,如下所示:
Error: You attempted to use a firebase module that's not installed on your Android project by calling firebase.app().
Ensure you have:
1) imported the 'io.invertase.firebase.app.ReactNativeFirebaseAppPackage' module in your 'MainApplication.java' file.
2) Added the 'new ReactNativeFirebaseAppPackage()' line inside of the RN 'getPackages()' method list.
我刚刚完成了让工具正常工作的尝试。你能告诉我还有什么其他方法可以让 Firebase 通知为不使用上述库的 React Native 项目工作吗?
【问题讨论】:
标签: android ios reactjs firebase react-native