Skip to content

Commit 896ee8d

Browse files
authored
Use actual openURL method on iOS (JetBrains#990)
Fixes the following error when calling `URIHandler_openUri` on iOS 18: ``` The caller of UIApplication.openURL(_:) needs to migrate to the non-deprecated UIApplication.open(_:options:completionHandler:). Force returning false (NO). ``` Fixes: https://youtrack.jetbrains.com/issue/CMP-6699
1 parent 355ede9 commit 896ee8d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

skiko/src/uikitMain/kotlin/org/jetbrains/skiko/Actuals.uikit.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import platform.Foundation.NSURL.Companion.URLWithString
44
import platform.UIKit.UIApplication
55

66
internal actual fun URIHandler_openUri(uri: String) {
7-
UIApplication.sharedApplication.openURL(URLWithString(uri)!!)
7+
UIApplication.sharedApplication.openURL(
8+
url = URLWithString(uri)!!,
9+
options = emptyMap<Any?, Any>(),
10+
completionHandler = null
11+
)
812
}
913

1014
// TODO: not sure if correct.

0 commit comments

Comments
 (0)