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

16 lines
601 B
Markdown
Raw Normal View History

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