Skip to content

Commit 9f3954f

Browse files
committed
Workaround: external library code is not visible to Swift.
1 parent 68bc2c0 commit 9f3954f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

iosApp/src/iOSApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
5151
_ application: UIApplication,
5252
didReceiveRemoteNotification userInfo: [AnyHashable: Any]
5353
) async -> UIBackgroundFetchResult {
54-
// NotifierManager.KotlinModules.onApplicationDidReceiveRemoteNotification(userInfo: userInfo)
54+
IOSNotificationsKt.onApplicationDidReceiveRemoteNotification(userInfo: userInfo)
5555
return UIBackgroundFetchResult.newData
5656
}
5757

shared/src@ios/org/jetbrains/kotlinconf/IOSNotifications.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jetbrains.kotlinconf
22

3+
import com.mmk.kmpnotifier.extensions.onApplicationDidReceiveRemoteNotification
34
import com.mmk.kmpnotifier.extensions.onNotificationClicked
45
import com.mmk.kmpnotifier.notification.NotifierManager
56
import org.jetbrains.kotlinconf.navigation.navigateByLocalNotificationId
@@ -19,3 +20,8 @@ fun handleNotificationResponse(response: UNNotificationResponse) {
1920
// Process push notifications
2021
NotifierManager.onNotificationClicked(content)
2122
}
23+
24+
@Suppress("unused") // Called from Swift
25+
fun onApplicationDidReceiveRemoteNotification(userInfo: Map<Any?, *>) {
26+
NotifierManager.onApplicationDidReceiveRemoteNotification(userInfo)
27+
}

0 commit comments

Comments
 (0)