react-native-firebase/README.md

75 lines
3.7 KiB
Markdown
Raw Normal View History

2017-03-24 03:00:03 +00:00
# React Native Firebase<img align="left" src="http://i.imgur.com/01XQL0x.png">
2017-02-14 16:02:54 +00:00
2017-03-23 17:05:28 +00:00
[![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)
[![License](https://img.shields.io/npm/l/react-native-firebase.svg)](/LICENSE)
2017-02-14 16:02:54 +00:00
2017-03-23 17:05:28 +00:00
**RNFirebase** makes using [Firebase](http://firebase.com) with React Native simple.
<hr>
### Install
2017-02-14 16:02:54 +00:00
```
npm i react-native-firebase --save
```
2017-03-23 17:05:28 +00:00
#### Platform specific setup guides:
2017-03-23 17:09:49 +00:00
[![ios](https://a.fsdn.com/sd/topics/ios_64.png)](docs/installation.ios.md) [![android](https://a.fsdn.com/sd/topics/android_64.png)](docs/installation.android.md)
2017-02-14 16:02:54 +00:00
2017-03-23 17:12:52 +00:00
<hr>
### Why
2017-02-14 16:02:54 +00:00
2017-03-23 17:05:28 +00:00
RNFirebase is a _light-weight_ layer sitting on-top of the native Firebase libraries for both iOS and Android which mirrors the Firebase Web SDK as closely as possible.
2017-03-23 17:12:52 +00:00
Although the [Firebase Web SDK](https://www.npmjs.com/package/firebase) library will work with React Native, it is mainly built for the web.
RNFirebase provides a JavaScript bridge to the native Firebase SDKs for both iOS and Android. Firebase 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 frame rate causing jank with animations, touch events etc. All in all, RNFirebase provides much faster performance (~2x) over the web SDK.
2017-02-14 16:02:54 +00:00
2017-03-23 17:12:52 +00:00
The native SDKs also allow us to hook into device sdk's which are not possible with the web SDK, for example crash reporting, offline realtime database support, analyics and more!
2017-02-14 16:02:54 +00:00
2017-03-23 17:12:52 +00:00
<hr>
2017-02-14 16:02:54 +00:00
2017-03-23 17:09:49 +00:00
### Test app
2017-03-16 16:27:01 +00:00
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.
2017-02-14 16:02:54 +00:00
2017-03-23 17:12:52 +00:00
<hr>
2017-03-23 17:09:49 +00:00
### Examples app
2017-02-14 16:02:54 +00:00
2017-03-16 16:27:01 +00:00
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.
2017-03-13 08:47:29 +00:00
2017-03-23 17:12:52 +00:00
<hr>
2017-03-23 17:09:49 +00:00
### Documentation
2017-03-13 08:47:29 +00:00
2017-03-16 16:27:01 +00:00
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.
2017-02-14 16:02:54 +00:00
2017-03-16 16:27:01 +00:00
> If you find any discrepancies between the two libraries, please raise an issue or PR.
2017-02-14 16:02:54 +00:00
* [Firebase Setup](docs/firebase-setup.md)
* API
* [Authentication](docs/api/authentication.md)
2017-03-17 14:58:28 +00:00
* [Realtime Database](docs/api/database.md)
2017-02-14 16:02:54 +00:00
* [Analytics](docs/api/analytics.md)
* [Storage](docs/api/storage.md)
2017-03-17 12:41:56 +00:00
* [Messaging](docs/api/cloud-messaging.md)
2017-03-17 14:58:28 +00:00
* [Crash](docs/api/crash.md)
2017-03-27 10:37:39 +00:00
* [Transactions](docs/api/transactions.md)
2017-02-14 16:02:54 +00:00
2017-03-23 17:12:52 +00:00
<hr>
2017-03-23 17:09:49 +00:00
### Contributing
2017-02-14 16:02:54 +00:00
2017-03-16 16:27:01 +00:00
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.
2017-03-23 01:21:18 +00:00
**Project board:** https://github.com/invertase/react-native-firebase/projects
2017-03-23 17:12:52 +00:00
<hr>
2017-03-23 17:09:49 +00:00
### License
2017-03-16 16:27:01 +00:00
- MIT