Skip to content

Commit

Permalink
Merge branch 'main' into desktop_support
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzemehdi committed Jul 7, 2024
2 parents 8e712d2 + 6807e2d commit 66e0e96
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {

allprojects {
group = "io.github.mirzemehdi"
version = "1.0.0"
version = "1.0.1"
val sonatypeUsername = gradleLocalProperties(rootDir).getProperty("sonatypeUsername")
val sonatypePassword = gradleLocalProperties(rootDir).getProperty("sonatypePassword")
val gpgKeySecret = gradleLocalProperties(rootDir).getProperty("gpgKeySecret")
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ koin = "3.5.6"
kotlinx-binary-validator = "0.13.2"
dokka = "1.9.10"
firebase-messaging = "24.0.0"
kotlinx-coroutine = "1.9.0-RC"


[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
kotlinx-coroutine = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutine" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
Expand Down
1 change: 1 addition & 0 deletions kmpnotifier/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ kotlin {
}
commonMain.dependencies {
implementation(libs.koin.core)
implementation(libs.kotlinx.coroutine)
}

commonTest.dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import cocoapods.FirebaseMessaging.FIRMessagingDelegateProtocol
import com.mmk.kmpnotifier.notification.NotifierManagerImpl
import com.mmk.kmpnotifier.notification.PushNotifier
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import platform.UIKit.UIApplication
import platform.UIKit.registerForRemoteNotifications
import platform.darwin.NSObject
Expand All @@ -16,9 +18,12 @@ import kotlin.coroutines.suspendCoroutine
internal class FirebasePushNotifierImpl : PushNotifier {

init {
println("FirebasePushNotifier is initialized")
UIApplication.sharedApplication.registerForRemoteNotifications()
FIRMessaging.messaging().delegate = FirebaseMessageDelegate()
MainScope().launch {
println("FirebasePushNotifier is initialized")
UIApplication.sharedApplication.registerForRemoteNotifications()
FIRMessaging.messaging().delegate = FirebaseMessageDelegate()
}

}


Expand Down

0 comments on commit 66e0e96

Please sign in to comment.