In kotlin multiplatform with IOS, I am trying to start the app via a link and some parameters:
iosstaging://open?userId=1234
That part works fine. Upon entering the link into safari, the browser asks if I would like to open the app and then proceeds to do so.
My problem is, that I am not receiving the parameters or the URL. I would except that the following function is called when the app starts (passing the URL as a parameter):
func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:] ) -> Bool
At least that is what I am understanding from the docs: Handle incoming URLs
But this is not the case. Instead, the "normal" application function is called:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool
Additionally: launchOptions are always nil.
My staging pinfo looks like this:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>de.myapp.app</string>
<key>CFBundleURLSchemes</key>
<array>
<string>iosstaging</string>
</array>
</dict>
</array>
Have I missed something within the pInfo file? Do I have to declare, besides naming the scheme, that I expect options to be passed?
I do not use any sceneDelegates and the outcome is always the same wether I start the app fresh or it was already running in the background: App starts fine via the link but the parameters (userId) are missing.
Running Kotlin 2.0.21 with Decompose and MVIKotlin
Any help is greatly appreciated
launchOptionshas info about custom url?launchOptionsbut it is alwaysNIL