From 896ee8d8043880c7b10d67a4a6ff5badd5c6e0e2 Mon Sep 17 00:00:00 2001 From: Andrei Salavei Date: Wed, 18 Sep 2024 17:50:32 +0200 Subject: [PATCH] Use actual openURL method on iOS (#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 --- .../uikitMain/kotlin/org/jetbrains/skiko/Actuals.uikit.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/skiko/src/uikitMain/kotlin/org/jetbrains/skiko/Actuals.uikit.kt b/skiko/src/uikitMain/kotlin/org/jetbrains/skiko/Actuals.uikit.kt index fa5220a654..a4e08c8474 100644 --- a/skiko/src/uikitMain/kotlin/org/jetbrains/skiko/Actuals.uikit.kt +++ b/skiko/src/uikitMain/kotlin/org/jetbrains/skiko/Actuals.uikit.kt @@ -4,7 +4,11 @@ import platform.Foundation.NSURL.Companion.URLWithString import platform.UIKit.UIApplication internal actual fun URIHandler_openUri(uri: String) { - UIApplication.sharedApplication.openURL(URLWithString(uri)!!) + UIApplication.sharedApplication.openURL( + url = URLWithString(uri)!!, + options = emptyMap(), + completionHandler = null + ) } // TODO: not sure if correct.