Skip to content

Commit 45595fc

Browse files
committed
Fix GCM Sender ID on Android/iOS
1 parent eb56044 commit 45595fc

File tree

2 files changed

+5
-5
lines changed
  • firebase-app/src

2 files changed

+5
-5
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ actual fun Firebase.initialize(context: Any?, options: FirebaseOptions, name: St
2929
actual fun Firebase.initialize(context: Any?, options: FirebaseOptions) =
3030
FirebaseApp(com.google.firebase.FirebaseApp.initializeApp(context as Context, options.toAndroid()))
3131

32-
actual class FirebaseApp internal constructor(val android: com.google.firebase.FirebaseApp) {
32+
actual data class FirebaseApp internal constructor(val android: com.google.firebase.FirebaseApp) {
3333
actual val name: String
3434
get() = android.name
3535
actual val options: FirebaseOptions
36-
get() = android.options.run { FirebaseOptions(applicationId, apiKey, databaseUrl, gaTrackingId, storageBucket, projectId) }
36+
get() = android.options.run { FirebaseOptions(applicationId, apiKey, databaseUrl, gaTrackingId, storageBucket, projectId, gcmSenderId) }
3737

3838
actual suspend fun delete() {
3939
android.delete()
@@ -51,4 +51,4 @@ private fun FirebaseOptions.toAndroid() = com.google.firebase.FirebaseOptions.Bu
5151
.setStorageBucket(storageBucket)
5252
.setProjectId(projectId)
5353
.setGcmSenderId(gcmSenderId)
54-
.build()
54+
.build()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ actual fun Firebase.initialize(context: Any?, options: FirebaseOptions, name: St
2727
actual fun Firebase.initialize(context: Any?, options: FirebaseOptions) =
2828
FIRApp.configureWithOptions(options.toIos()).let { app }
2929

30-
actual class FirebaseApp internal constructor(val ios: FIRApp) {
30+
actual data class FirebaseApp internal constructor(val ios: FIRApp) {
3131
actual val name: String
3232
get() = ios.name
3333
actual val options: FirebaseOptions
34-
get() = ios.options.run { FirebaseOptions(bundleID, APIKey!!, databaseURL!!, trackingID, storageBucket, projectID) }
34+
get() = ios.options.run { FirebaseOptions(bundleID, APIKey!!, databaseURL!!, trackingID, storageBucket, projectID, GCMSenderID) }
3535

3636
actual suspend fun delete() {
3737
val deleted = CompletableDeferred<Unit>()

0 commit comments

Comments
 (0)