What are the differences between react-native-firebase & Firebase npm packages

放肆的年华 提交于 2020-12-15 03:42:20

问题


If I, for instance, wanted to use firebase's services in a react-native project for things like Auth, google cloud messenger, realtime database, push notifications, A/B testing, and crash reporting, would I choose to npm install the firebase package or the react-native-firebase package?

What are the differences between the two? I'm confused because I thought react-native-firebase was utilizing the whole Firebase SDK which seems to make the Firebase package unnecessary? I found this link: Firebase vs. react-native-firebase, but it didn't clear anything up for me. I'm looking for a practical, in-depth comparison of the two, or what they are and why there are two different ones.


回答1:


The firebase NPM package is the Firebase SDK for JavaScript developers that run their code in a web browser. It contains the Firebase products for which Firebase itself provides a native JavaScript SDK, mostly things like the databases, authentication, etc.

The reactive-native-firebase package is a 3rd party SDK for ReactNative developers that run their code in iOS and Android apps. It wraps the native Firebase SDKs for those platforms in a JavaScript SDK, which also includes things like analytics, dynamic links, in-app messaging, etc.



来源:https://stackoverflow.com/questions/57982557/what-are-the-differences-between-react-native-firebase-firebase-npm-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!