Skip to content

Commit 92b4fa8

Browse files
committed
add info on getDatabasePath to README
1 parent a7c22d1 commit 92b4fa8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ FirebasePlatform.initializeFirebasePlatform(object : FirebasePlatform() {
5959
})
6060
```
6161

62+
#### Customizing Firestore offline data persistence database location
63+
64+
The `FirebasePlatform` interface also includes a `getDatabasePath` method for you to override if the following default implementation is not suitable:
65+
66+
```kotlin
67+
open fun getDatabasePath(name: String): File = File("${System.getProperty("java.io.tmpdir")}${File.separatorChar}$name")
68+
```
69+
70+
This is used by Firestore to support [offline data persistence](https://firebase.google.com/docs/firestore/manage-data/enable-offline).
71+
72+
#### Initialize the Firebase application
73+
6274
It is also up to you to initialize the Firebase application object manually (unlike the Android SDK which is normally initialized via
6375
the configuration file).
6476

0 commit comments

Comments
 (0)