This commit is contained in:
Salakar 2017-03-16 17:08:43 +00:00
commit 86498b76d0
2 changed files with 22 additions and 15 deletions

View File

@ -6,32 +6,34 @@ RNFirebase makes using the latest [Firebase](http://firebase.com) with React Nat
npm i react-native-firebase --save npm i react-native-firebase --save
``` ```
[![Gitter](https://badges.gitter.im/invertase/firebase.svg)](https://gitter.im/invertase/firebase?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Gitter](https://badges.gitter.im/invertase/react-native-firebase.svg)](https://gitter.im/invertase/react-native-firebase?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![npm version](https://img.shields.io/npm/v/react-native-firebase.svg)](https://www.npmjs.com/package/react-native-firebase) [![npm version](https://img.shields.io/npm/v/react-native-firebase.svg)](https://www.npmjs.com/package/react-native-firebase)
[![License](https://img.shields.io/npm/l/react-native-firebase.svg)](/LICENSE) [![License](https://img.shields.io/npm/l/react-native-firebase.svg)](/LICENSE)
RNFirebase is a _light-weight_ layer sitting on-top of the native Firebase libraries for both iOS and Android which mirrors the React Native JS api as closely as possible. RNFirebase is a _light-weight_ layer sitting on-top of the native Firebase libraries for both iOS and Android which mirrors the React Native JS api as closely as possible.
Featuring; authentication, storage, real-time database, presence, analytics, cloud messaging, remote configuration, redux support and more! ## RNFirebase vs Firebase Web SDK
## RNFirebase vs Firebase JS lib Although the [Firebase Web SDK](https://www.npmjs.com/package/firebase) library will work with React Native, it is built for the web.
Although the [Firebase](https://www.npmjs.com/package/firebase) JavaScript library will work with React Native, it is mainly designed for the web. RNFirebase provides a JavaScript bridge to the native Firebase SDKs for both iOS and Android. The Firebase processes will run on the native thread, allowing the rest of your app to run on the [JS thread](https://facebook.github.io/react-native/docs/performance.html#javascript-frame-rate). The Firebase Web SDK also runs on the JS thread, therefore potentially affecting the frane rate causing jank with animations, touch events etc. All in, RNFirebase provides much faster performance (~2x) over the web SDK.
The native SDK's are much better for performance compared to the web SDK. The web SDK will run on the same thread as your apps ([JS thread](https://facebook.github.io/react-native/docs/performance.html#javascript-frame-rate)) therefore limiting your JS framerate, potentially affecting things touch events and transitions/animations. The native SDKs allow allow us to hook into device events which are not possible with the web SDK, for example crash reporting, offiline realtime database support, analyics and more!
The native SDK's also contains functionality that the web SDK's do not, for example [Analytics](/docs/api/analytics.md) and [Remote Config](/docs/api/remote-config.md).
## Examples app
There's currently a work in progress [examples app](https://github.com/invertase/react-native-firebase-examples) which aims to demonstrate various real world use-case scenarios with React Native & Firebase. We welcome any new examples or updates to existing ones, however please do not overcomplicate them.
## Test app ## Test app
To help ensure changes and features work across both iOS & Android, we've developed an app specifically to test `react-native-firebase` against the [`firebase` web SDK](https://www.npmjs.com/package/firebase). Please see the [`react-native-firebase-tests`](https://github.com/invertase/react-native-firebase-tests) repository for more information. To help ensure changes and features work across both iOS & Android, we've developed an app specifically to test `react-native-firebase` against the [`firebase` web SDK](https://www.npmjs.com/package/firebase). Please see the [`react-native-firebase-tests`](https://github.com/invertase/react-native-firebase-tests) repository for more information.
## Examples app
There's currently a work in progress [examples app](https://github.com/invertase/react-native-firebase-examples) which aims to demonstrate various real world use-case scenarios with React Native & Firebase. We welcome any new examples or updates to existing ones.
## Documentation ## Documentation
RNFirebase aims to replicate the Firebase Web SDK as closely as possible. Because of this, the documentation focuses around the installation, differences & best practices of this library. Please see the [Firebase Web SDK](https://firebase.google.com/docs/reference/js/) documentation for Firebase functionality.
> If you find any discrepancies between the two libraries, please raise an issue or PR.
* Installation * Installation
* [iOS](docs/installation.ios.md) * [iOS](docs/installation.ios.md)
* [Android](docs/installation.android.md) * [Android](docs/installation.android.md)
@ -46,8 +48,13 @@ To help ensure changes and features work across both iOS & Android, we've develo
* [Cloud Messaging](docs/api/cloud-messaging.md) * [Cloud Messaging](docs/api/cloud-messaging.md)
* [Remote Config](docs/api/remote-config.md) * [Remote Config](docs/api/remote-config.md)
* [Events](docs/api/events.md) * [Events](docs/api/events.md)
* [Redux](docs/redux.md)
## Contributing ## Contributing
- TODO We welcome any contribution to the repository. Please ensure your changes to the JavaScript code follow the styling guides controlled by ESlint. Changes to native code should be kept clean and follow the standard of existing code.
Changes to existing code should ensure all relevant tests on the test app pass. Any new features should have new tests created and ensure all existing tests pass.
## License
- MIT

View File

@ -1,7 +1,7 @@
# Analytics # Analytics
Integrating Firebase analytics is super simple using RNFirebase. A number of methods are provided to help tailor analytics specifically for your Integrating Firebase analytics is simple. A number of methods are provided to help tailor analytics specifically for your
own app. The Firebase SDK includes a number of pre-set events which are automatically handled, and cannot be used with custom events: own app. The Firebase SDK includes a number of pre-set events which are automatically handled, and cannot be used with custom `logEvent` events:
``` ```
'app_clear_data', 'app_clear_data',