Skip to content

Commit

Permalink
Use actual openURL method on iOS (#990)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ASalavei committed Sep 18, 2024
1 parent 355ede9 commit 896ee8d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Any?, Any>(),
completionHandler = null
)
}

// TODO: not sure if correct.
Expand Down

0 comments on commit 896ee8d

Please sign in to comment.