0.0.3 • Published 9 years ago

firebase-react-native v0.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

firebase-react-native

Currently, the firebase client api doesn't support react native. There are few reasons:

  • JSC doesn't include WebSockets, so it has to be polyfilled
  • firebase.js uses DOM stuff like document.createElement to create iframes. This isn't available in JSC either
  • firebase.js expects to be run inside of a browser or node, and neither are quite the same as running javascript with react-native

So, I essentially hacked the latest version of firebase-debug.js to death, and now it works with react native when used in conjunction with Harrison Harnish's excellent websocket polyfill.

Disclaimer

As mentioned above, this is super hacky and barely tested. Don't try to use this in production. Eventually firebase and react-native will play nice together and this repo will become obsolete. But for now, you're able to mash the two together and have some fun.

Usage

npm install --save firebase-react-native

Then start using it in your code: var Firebase = require('firebase-react-native');

You also need to import the websocket polyfill into your react-native project. Below are instructions I use, but there may be easier paths with less steps:

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago