From 45595fc73a4f22132c6d177e48af68fe515acfe3 Mon Sep 17 00:00:00 2001 From: Gijs van Veen Date: Tue, 19 Dec 2023 17:02:00 +0100 Subject: [PATCH] Fix GCM Sender ID on Android/iOS --- .../src/androidMain/kotlin/dev/gitlive/firebase/firebase.kt | 6 +++--- .../src/iosMain/kotlin/dev/gitlive/firebase/firebase.kt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/firebase-app/src/androidMain/kotlin/dev/gitlive/firebase/firebase.kt b/firebase-app/src/androidMain/kotlin/dev/gitlive/firebase/firebase.kt index fe3f354aa..37c834ac3 100644 --- a/firebase-app/src/androidMain/kotlin/dev/gitlive/firebase/firebase.kt +++ b/firebase-app/src/androidMain/kotlin/dev/gitlive/firebase/firebase.kt @@ -29,11 +29,11 @@ actual fun Firebase.initialize(context: Any?, options: FirebaseOptions, name: St actual fun Firebase.initialize(context: Any?, options: FirebaseOptions) = FirebaseApp(com.google.firebase.FirebaseApp.initializeApp(context as Context, options.toAndroid())) -actual class FirebaseApp internal constructor(val android: com.google.firebase.FirebaseApp) { +actual data class FirebaseApp internal constructor(val android: com.google.firebase.FirebaseApp) { actual val name: String get() = android.name actual val options: FirebaseOptions - get() = android.options.run { FirebaseOptions(applicationId, apiKey, databaseUrl, gaTrackingId, storageBucket, projectId) } + get() = android.options.run { FirebaseOptions(applicationId, apiKey, databaseUrl, gaTrackingId, storageBucket, projectId, gcmSenderId) } actual suspend fun delete() { android.delete() @@ -51,4 +51,4 @@ private fun FirebaseOptions.toAndroid() = com.google.firebase.FirebaseOptions.Bu .setStorageBucket(storageBucket) .setProjectId(projectId) .setGcmSenderId(gcmSenderId) - .build() \ No newline at end of file + .build() diff --git a/firebase-app/src/iosMain/kotlin/dev/gitlive/firebase/firebase.kt b/firebase-app/src/iosMain/kotlin/dev/gitlive/firebase/firebase.kt index e3074d2dc..f28d6ddee 100644 --- a/firebase-app/src/iosMain/kotlin/dev/gitlive/firebase/firebase.kt +++ b/firebase-app/src/iosMain/kotlin/dev/gitlive/firebase/firebase.kt @@ -27,11 +27,11 @@ actual fun Firebase.initialize(context: Any?, options: FirebaseOptions, name: St actual fun Firebase.initialize(context: Any?, options: FirebaseOptions) = FIRApp.configureWithOptions(options.toIos()).let { app } -actual class FirebaseApp internal constructor(val ios: FIRApp) { +actual data class FirebaseApp internal constructor(val ios: FIRApp) { actual val name: String get() = ios.name actual val options: FirebaseOptions - get() = ios.options.run { FirebaseOptions(bundleID, APIKey!!, databaseURL!!, trackingID, storageBucket, projectID) } + get() = ios.options.run { FirebaseOptions(bundleID, APIKey!!, databaseURL!!, trackingID, storageBucket, projectID, GCMSenderID) } actual suspend fun delete() { val deleted = CompletableDeferred()