Skip to content

Commit 687fed4

Browse files
authored
Update README.md
1 parent 1cc9604 commit 687fed4

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,24 @@ To improve readability functions such as the Cloud Firestore query operators use
9090
```kotlin
9191
citiesRef.whereEqualTo("state", "CA")
9292
citiesRef.whereArrayContains("regions", "west_coast")
93-
9493
//...becomes...
9594
citiesRef.where("state", equalTo = "CA")
9695
citiesRef.where("regions", arrayContains = "west_coast")
9796
````
9897

99-
<h2><a href="https://kotlinlang.org/docs/reference/multiplatform.html">Multiplatform</a></h2>
98+
## Multiplatform
99+
100+
The Firebase Kotlin SDK provides a common API to access Firebase for projects targeting *iOS*, *Android* and *JS* meaning you can use Firebase directly in your common code. Under the hood, the SDK achieves this by binding to the respective official Firebase SDK for each supported platform.
101+
102+
In some cases you might want to access the underlying official Firebase SDK in platform specific code, for example when the common API is missing the functionality you need. For this purpose each class in the SDK has `android`, `ios` and `js` properties which holds the equivalent object of the underlying official Firebase SDK.
103+
104+
These properties are only accessible from the equivalent target's source set. For example to disable persistence in Cloud Firestore on Android you can write the following in your Android specific code (e.g. `androidMain` or `androidTest`):
105+
106+
```kotlin
107+
Firebase.firestore.android.firestoreSettings = FirebaseFirestoreSettings.Builder(Firebase.firestore.android.firestoreSettings)
108+
.setPersistenceEnabled(false)
109+
.build()
110+
```
111+
112+
113+

0 commit comments

Comments
 (0)