Skip to content

Commit ff61dd2

Browse files
committed
Changed firebase app to use extension method with same name
1 parent c800594 commit ff61dd2

File tree

18 files changed

+35
-35
lines changed
  • firebase-app/src
  • firebase-auth/src
    • androidMain/kotlin/dev/gitlive/firebase/auth
    • iosMain/kotlin/dev/gitlive/firebase/auth
  • firebase-config/src
  • firebase-crashlytics/src/androidMain/kotlin/dev/gitlive/firebase/crashlytics
  • firebase-database/src
    • androidMain/kotlin/dev/gitlive/firebase/database
    • iosMain/kotlin/dev/gitlive/firebase/database
  • firebase-firestore/src
  • firebase-functions/src
  • firebase-installations/src
  • firebase-perf/src/androidMain/kotlin/dev/gitlive/firebase/perf
  • firebase-storage/src
    • androidMain/kotlin/dev/gitlive/firebase/storage
    • iosMain/kotlin/dev/gitlive/firebase/storage

18 files changed

+35
-35
lines changed

firebase-app/src/androidMain/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public actual typealias FirebaseTooManyRequestsException = com.google.firebase.F
1414

1515
public actual typealias FirebaseApiNotAvailableException = com.google.firebase.FirebaseApiNotAvailableException
1616

17-
public val FirebaseApp.publicAndroid: com.google.firebase.FirebaseApp get() = com.google.firebase.FirebaseApp.getInstance()
17+
public val FirebaseApp.android: com.google.firebase.FirebaseApp get() = android
1818

1919
public actual val Firebase.app: FirebaseApp
2020
get() = FirebaseApp(com.google.firebase.FirebaseApp.getInstance())

firebase-app/src/iosMain/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public actual open class FirebaseNetworkException(message: String) : FirebaseExc
1212
public actual open class FirebaseTooManyRequestsException(message: String) : FirebaseException(message)
1313
public actual open class FirebaseApiNotAvailableException(message: String) : FirebaseException(message)
1414

15-
public val FirebaseApp.publicIos: FIRApp get() = ios
15+
public val FirebaseApp.ios: FIRApp get() = ios
1616

1717
public actual val Firebase.app: FirebaseApp
1818
get() = FirebaseApp(FIRApp.defaultApp()!!)

firebase-auth/src/androidMain/kotlin/dev/gitlive/firebase/auth/auth.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import com.google.firebase.auth.ActionCodeResult.*
1212
import com.google.firebase.auth.FirebaseAuth.AuthStateListener
1313
import dev.gitlive.firebase.Firebase
1414
import dev.gitlive.firebase.FirebaseApp
15-
import dev.gitlive.firebase.publicAndroid
15+
import dev.gitlive.firebase.android as publicAndroid
1616
import kotlinx.coroutines.channels.awaitClose
1717
import kotlinx.coroutines.flow.Flow
1818
import kotlinx.coroutines.flow.callbackFlow

firebase-auth/src/iosMain/kotlin/dev/gitlive/firebase/auth/auth.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import dev.gitlive.firebase.FirebaseApp
1010
import dev.gitlive.firebase.FirebaseException
1111
import dev.gitlive.firebase.FirebaseNetworkException
1212
import dev.gitlive.firebase.auth.ActionCodeResult.*
13-
import dev.gitlive.firebase.publicIos
13+
import dev.gitlive.firebase.ios
1414
import kotlinx.cinterop.*
1515
import kotlinx.coroutines.CompletableDeferred
1616
import kotlinx.coroutines.channels.awaitClose
@@ -25,7 +25,7 @@ public actual val Firebase.auth: FirebaseAuth
2525
get() = FirebaseAuth(FIRAuth.auth())
2626

2727
public actual fun Firebase.auth(app: FirebaseApp): FirebaseAuth = FirebaseAuth(
28-
FIRAuth.authWithApp(app.publicIos as objcnames.classes.FIRApp),
28+
FIRAuth.authWithApp(app.ios as objcnames.classes.FIRApp),
2929
)
3030

3131
public actual class FirebaseAuth internal constructor(internal val ios: FIRAuth) {

firebase-config/src/androidMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.google.firebase.remoteconfig.FirebaseRemoteConfigFetchThrottledExcept
77
import com.google.firebase.remoteconfig.FirebaseRemoteConfigServerException
88
import dev.gitlive.firebase.Firebase
99
import dev.gitlive.firebase.FirebaseApp
10-
import dev.gitlive.firebase.publicAndroid
10+
import dev.gitlive.firebase.android
1111
import kotlinx.coroutines.tasks.await
1212
import kotlinx.datetime.Instant
1313
import kotlin.time.Duration
@@ -22,7 +22,7 @@ public actual val Firebase.remoteConfig: FirebaseRemoteConfig
2222
get() = FirebaseRemoteConfig(com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance())
2323

2424
public actual fun Firebase.remoteConfig(app: FirebaseApp): FirebaseRemoteConfig =
25-
FirebaseRemoteConfig(com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(app.publicAndroid))
25+
FirebaseRemoteConfig(com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(app.android))
2626

2727
public actual class FirebaseRemoteConfig internal constructor(internal val android: AndroidFirebaseRemoteConfig) {
2828
public actual val all: Map<String, FirebaseRemoteConfigValue>

firebase-config/src/iosMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import dev.gitlive.firebase.Firebase
1212
import dev.gitlive.firebase.FirebaseApp
1313
import dev.gitlive.firebase.FirebaseException
1414
import dev.gitlive.firebase.app
15-
import dev.gitlive.firebase.publicIos
15+
import dev.gitlive.firebase.ios
1616
import kotlinx.coroutines.CompletableDeferred
1717
import kotlinx.datetime.Instant
1818
import kotlinx.datetime.toKotlinInstant
@@ -27,7 +27,7 @@ public actual val Firebase.remoteConfig: FirebaseRemoteConfig
2727
get() = FirebaseRemoteConfig(FIRRemoteConfig.remoteConfig())
2828

2929
public actual fun Firebase.remoteConfig(app: FirebaseApp): FirebaseRemoteConfig = FirebaseRemoteConfig(
30-
FIRRemoteConfig.remoteConfigWithApp(Firebase.app.publicIos as objcnames.classes.FIRApp),
30+
FIRRemoteConfig.remoteConfigWithApp(Firebase.app.ios as objcnames.classes.FIRApp),
3131
)
3232

3333
public actual class FirebaseRemoteConfig internal constructor(internal val ios: FIRRemoteConfig) {

firebase-crashlytics/src/androidMain/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import com.google.firebase.FirebaseException
44
import com.google.firebase.crashlytics.CustomKeysAndValues.Builder
55
import dev.gitlive.firebase.Firebase
66
import dev.gitlive.firebase.FirebaseApp
7-
import dev.gitlive.firebase.publicAndroid
7+
import dev.gitlive.firebase.android
88

99
public val FirebaseCrashlytics.android: com.google.firebase.crashlytics.FirebaseCrashlytics get() = com.google.firebase.crashlytics.FirebaseCrashlytics.getInstance()
1010

1111
public actual val Firebase.crashlytics: FirebaseCrashlytics get() =
1212
FirebaseCrashlytics(com.google.firebase.crashlytics.FirebaseCrashlytics.getInstance())
1313

1414
public actual fun Firebase.crashlytics(app: FirebaseApp): FirebaseCrashlytics =
15-
FirebaseCrashlytics(app.publicAndroid.get(com.google.firebase.crashlytics.FirebaseCrashlytics::class.java))
15+
FirebaseCrashlytics(app.android.get(com.google.firebase.crashlytics.FirebaseCrashlytics::class.java))
1616

1717
public actual class FirebaseCrashlytics internal constructor(internal val android: com.google.firebase.crashlytics.FirebaseCrashlytics) {
1818

firebase-database/src/androidMain/kotlin/dev/gitlive/firebase/database/database.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import dev.gitlive.firebase.EncodeDecodeSettingsBuilder
1818
import dev.gitlive.firebase.internal.EncodedObject
1919
import dev.gitlive.firebase.Firebase
2020
import dev.gitlive.firebase.FirebaseApp
21+
import dev.gitlive.firebase.android
2122
import dev.gitlive.firebase.database.ChildEvent.Type
2223
import dev.gitlive.firebase.internal.android
2324
import dev.gitlive.firebase.internal.decode
2425
import dev.gitlive.firebase.internal.reencodeTransformation
25-
import dev.gitlive.firebase.publicAndroid
2626
import kotlinx.coroutines.CompletableDeferred
2727
import kotlinx.coroutines.channels.awaitClose
2828
import kotlinx.coroutines.channels.trySendBlocking
@@ -62,10 +62,10 @@ public actual fun Firebase.database(url: String): FirebaseDatabase =
6262
FirebaseDatabase.getInstance(com.google.firebase.database.FirebaseDatabase.getInstance(url))
6363

6464
public actual fun Firebase.database(app: FirebaseApp): FirebaseDatabase =
65-
FirebaseDatabase.getInstance(com.google.firebase.database.FirebaseDatabase.getInstance(app.publicAndroid))
65+
FirebaseDatabase.getInstance(com.google.firebase.database.FirebaseDatabase.getInstance(app.android))
6666

6767
public actual fun Firebase.database(app: FirebaseApp, url: String): FirebaseDatabase =
68-
FirebaseDatabase.getInstance(com.google.firebase.database.FirebaseDatabase.getInstance(app.publicAndroid, url))
68+
FirebaseDatabase.getInstance(com.google.firebase.database.FirebaseDatabase.getInstance(app.android, url))
6969

7070
public actual class FirebaseDatabase internal constructor(internal val android: com.google.firebase.database.FirebaseDatabase) {
7171

firebase-database/src/iosMain/kotlin/dev/gitlive/firebase/database/database.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import dev.gitlive.firebase.internal.EncodedObject
2828
import dev.gitlive.firebase.internal.decode
2929
import dev.gitlive.firebase.internal.ios
3030
import dev.gitlive.firebase.internal.reencodeTransformation
31-
import dev.gitlive.firebase.publicIos
31+
import dev.gitlive.firebase.ios
3232
import kotlinx.coroutines.CompletableDeferred
3333
import kotlinx.coroutines.FlowPreview
3434
import kotlinx.coroutines.channels.awaitClose
@@ -52,11 +52,11 @@ public actual fun Firebase.database(url: String): FirebaseDatabase =
5252
FirebaseDatabase(FIRDatabase.databaseWithURL(url))
5353

5454
public actual fun Firebase.database(app: FirebaseApp): FirebaseDatabase = FirebaseDatabase(
55-
FIRDatabase.databaseForApp(app.publicIos as objcnames.classes.FIRApp),
55+
FIRDatabase.databaseForApp(app.ios as objcnames.classes.FIRApp),
5656
)
5757

5858
public actual fun Firebase.database(app: FirebaseApp, url: String): FirebaseDatabase = FirebaseDatabase(
59-
FIRDatabase.databaseForApp(app.publicIos as objcnames.classes.FIRApp, url),
59+
FIRDatabase.databaseForApp(app.ios as objcnames.classes.FIRApp, url),
6060
)
6161

6262
public actual class FirebaseDatabase internal constructor(internal val ios: FIRDatabase) {

firebase-firestore/src/androidMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ package dev.gitlive.firebase.firestore
99
import com.google.android.gms.tasks.TaskExecutors
1010
import dev.gitlive.firebase.Firebase
1111
import dev.gitlive.firebase.FirebaseApp
12+
import dev.gitlive.firebase.android
1213
import dev.gitlive.firebase.firestore.internal.NativeDocumentSnapshotWrapper
13-
import dev.gitlive.firebase.publicAndroid
1414
import java.util.concurrent.Executor
1515
import com.google.firebase.firestore.CollectionReference as AndroidCollectionReference
1616
import com.google.firebase.firestore.DocumentChange as AndroidDocumentChange
@@ -37,7 +37,7 @@ public actual val Firebase.firestore: FirebaseFirestore get() =
3737
FirebaseFirestore(AndroidFirebaseFirestore.getInstance())
3838

3939
public actual fun Firebase.firestore(app: FirebaseApp): FirebaseFirestore =
40-
FirebaseFirestore(AndroidFirebaseFirestore.getInstance(app.publicAndroid))
40+
FirebaseFirestore(AndroidFirebaseFirestore.getInstance(app.android))
4141

4242
public val LocalCacheSettings.android: AndroidLocalCacheSettings get() = when (this) {
4343
is LocalCacheSettings.Persistent -> androidPersistentCacheSettings {

0 commit comments

Comments
 (0)