File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed
src/iosMain/kotlin/com/mmk/kmpnotifier/firebase Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ plugins {
2121
2222allprojects {
2323 group = " io.github.mirzemehdi"
24- version = " 1.0.0 "
24+ version = " 1.0.1 "
2525 val sonatypeUsername = gradleLocalProperties(rootDir).getProperty(" sonatypeUsername" )
2626 val sonatypePassword = gradleLocalProperties(rootDir).getProperty(" sonatypePassword" )
2727 val gpgKeySecret = gradleLocalProperties(rootDir).getProperty(" gpgKeySecret" )
Original file line number Diff line number Diff line change @@ -19,11 +19,13 @@ koin = "3.5.6"
1919kotlinx-binary-validator = " 0.13.2"
2020dokka = " 1.9.10"
2121firebase-messaging = " 24.0.0"
22+ kotlinx-coroutine = " 1.9.0-RC"
2223
2324
2425[libraries ]
2526kotlin-test = { module = " org.jetbrains.kotlin:kotlin-test" , version.ref = " kotlin" }
2627kotlin-test-junit = { module = " org.jetbrains.kotlin:kotlin-test-junit" , version.ref = " kotlin" }
28+ kotlinx-coroutine = { module = " org.jetbrains.kotlinx:kotlinx-coroutines-core" , version.ref = " kotlinx-coroutine" }
2729junit = { group = " junit" , name = " junit" , version.ref = " junit" }
2830compose-ui = { module = " androidx.compose.ui:ui" , version.ref = " compose" }
2931compose-ui-tooling = { module = " androidx.compose.ui:ui-tooling" , version.ref = " compose" }
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ kotlin {
4545 }
4646 commonMain.dependencies {
4747 implementation(libs.koin.core)
48+ implementation(libs.kotlinx.coroutine)
4849 }
4950 }
5051}
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import cocoapods.FirebaseMessaging.FIRMessagingDelegateProtocol
55import com.mmk.kmpnotifier.notification.NotifierManagerImpl
66import com.mmk.kmpnotifier.notification.PushNotifier
77import kotlinx.cinterop.ExperimentalForeignApi
8+ import kotlinx.coroutines.MainScope
9+ import kotlinx.coroutines.launch
810import platform.UIKit.UIApplication
911import platform.UIKit.registerForRemoteNotifications
1012import platform.darwin.NSObject
@@ -16,9 +18,12 @@ import kotlin.coroutines.suspendCoroutine
1618internal class FirebasePushNotifierImpl : PushNotifier {
1719
1820 init {
19- println (" FirebasePushNotifier is initialized" )
20- UIApplication .sharedApplication.registerForRemoteNotifications()
21- FIRMessaging .messaging().delegate = FirebaseMessageDelegate ()
21+ MainScope ().launch {
22+ println (" FirebasePushNotifier is initialized" )
23+ UIApplication .sharedApplication.registerForRemoteNotifications()
24+ FIRMessaging .messaging().delegate = FirebaseMessageDelegate ()
25+ }
26+
2227 }
2328
2429
You can’t perform that action at this time.
0 commit comments