Skip to content

Commit

Permalink
Merge pull request #447 from splendo/feature/fix-gcm-sender0id
Browse files Browse the repository at this point in the history
Fix passing GCMSenderId to FirebaseOptions on Android/iOS
  • Loading branch information
nbransby authored Apr 1, 2024
2 parents a2f103d + e316f61 commit 7a49f42
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -51,4 +51,4 @@ private fun FirebaseOptions.toAndroid() = com.google.firebase.FirebaseOptions.Bu
.setStorageBucket(storageBucket)
.setProjectId(projectId)
.setGcmSenderId(gcmSenderId)
.build()
.build()
Original file line number Diff line number Diff line change
Expand Up @@ -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<Unit>()
Expand Down
2 changes: 1 addition & 1 deletion firebase-crashlytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitlive/firebase-crashlytics",
"version": "1.11.1",
"version": "1.12.0",
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
"main": "firebase-crashlytics.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion firebase-installations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitlive/firebase-installations",
"version": "1.11.1",
"version": "1.12.0",
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
"main": "firebase-installations.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion firebase-perf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitlive/firebase-perf",
"version": "1.11.1",
"version": "1.12.0",
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
"main": "firebase-perf.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion firebase-storage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitlive/firebase-storage",
"version": "1.11.1",
"version": "1.12.0",
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
"main": "firebase-storage.js",
"scripts": {
Expand Down

0 comments on commit 7a49f42

Please sign in to comment.