2
0
mirror of synced 2025-01-12 15:14:39 +00:00

28 lines
712 B
Markdown
Raw Normal View History

2017-04-27 12:18:12 +01:00
# Usage
2017-08-26 06:06:30 +01:00
After creating a Firebase project and installing the library, you can then use it in your project by importing the library in your JavaScript code:
2017-04-27 12:18:12 +01:00
```javascript
2017-08-26 06:04:17 +01:00
import firebase from 'react-native-firebase';
2017-04-27 12:18:12 +01:00
```
2017-08-26 06:04:17 +01: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 12:18:12 +01:00
```javascript
2017-08-26 06:04:17 +01:00
import firebase from 'react-native-firebase';
2017-04-27 12:18:12 +01:00
2017-08-26 06:04:17 +01:00
firebase.auth().signInAnonymously()
.then((user) => {
console.log(user.isAnonymous);
});
```
2017-04-27 12:18:12 +01:00
2017-08-26 06:04:17 +01:00
### Configure Default App Instance
2017-04-27 12:18:12 +01:00
2017-08-26 06:46:37 +01:00
See [configure the default app instance](/core/config-default-app).
2017-04-27 12:18:12 +01:00
2017-08-26 06:04:17 +01:00
### Configuring RNFirebase
2017-04-27 12:18:12 +01:00
2017-08-26 06:46:37 +01:00
See [configure RNFirebase](/core/config-rnfirebase).
2017-04-27 12:18:12 +01:00