react-native-firebase/docs/core/config-default-app.md

16 lines
630 B
Markdown
Raw Normal View History

<!-- TODO -->
### Enable Database Persistence
2017-10-04 20:18:20 +00:00
Enabling database persistence (setPersistence) via JS for the default app is no longer supported. This breaking change was added in v3 to prevent several race condition issues around.
2017-10-04 19:13:12 +00:00
You can still however easily enable this natively for the default app instance:
#### Android
2017-10-04 19:14:57 +00:00
Add `FirebaseDatabase.getInstance().setPersistenceEnabled(true);` inside your `MainActivity.java` files `onCreate()` method.
2017-10-04 19:13:12 +00:00
#### iOS
2017-10-04 19:14:57 +00:00
Add `[FIRDatabase database].persistenceEnabled = YES;` after the `[FIRApp configure];` line inside your `AppDelegate.m` files `didFinishLaunchingWithOptions` method.