react-native-firebase/docs/usage.md

28 lines
702 B
Markdown
Raw Normal View History

2017-04-27 11:18:12 +00:00
# Usage
After creating a Firebase project and installing the library, we can use it in our project by importing the library in our JavaScript:
```javascript
2017-08-26 05:04:17 +00:00
import firebase from 'react-native-firebase';
2017-04-27 11:18:12 +00:00
```
2017-08-26 05:04:17 +00:00
As the default app is pre-initialized natively there is no need to call `initializeApp` for the default app instance. Just import and go:
2017-04-27 11:18:12 +00:00
```javascript
2017-08-26 05:04:17 +00:00
import firebase from 'react-native-firebase';
2017-04-27 11:18:12 +00:00
2017-08-26 05:04:17 +00:00
firebase.auth().signInAnonymously()
.then((user) => {
console.log(user.isAnonymous);
});
```
2017-04-27 11:18:12 +00:00
2017-08-26 05:04:17 +00:00
### Configure Default App Instance
2017-04-27 11:18:12 +00:00
2017-08-26 05:04:17 +00:00
<!-- TODO document elsewhere and place a 'See X link' here-->
2017-04-27 11:18:12 +00:00
2017-08-26 05:04:17 +00:00
### Configuring RNFirebase
2017-04-27 11:18:12 +00:00
2017-08-26 05:04:17 +00:00
<!-- TODO document elsewhere and place a 'See X link' here-->
2017-04-27 11:18:12 +00:00