Hi - first, this article and the examples here were extremely helpful to me, thank you!
I think one small detail is missing on the iOS implementation. In the platform method channel handler, when the "initialLink" method is called - it is not returning any value.
The code in question is here https://github.com/DenisovAV/deep_links_flutter/blob/master/ios/Runner/AppDelegate.swift#L23
I believe what needs to happen, to handle deep links that launch the app, is to add this line in the didFinishLaunchingWithOptions function in AppDelegate, to capture any initial link url:
let initialLink = launchOptions?[.url] as? String
Then, inside the setMethodCallHandler, as long as it passes the existing guard statement (the "initialLink" method check), return a result with this initialLink value.
methodChannel?.setMethodCallHandler({ (call: FlutterMethodCall, result: FlutterResult) in
guard call.method == "initialLink" else {
result(FlutterMethodNotImplemented)
return
}
result(initialLink)
})
Hi - first, this article and the examples here were extremely helpful to me, thank you!
I think one small detail is missing on the iOS implementation. In the platform method channel handler, when the "initialLink" method is called - it is not returning any value.
The code in question is here https://github.com/DenisovAV/deep_links_flutter/blob/master/ios/Runner/AppDelegate.swift#L23
I believe what needs to happen, to handle deep links that launch the app, is to add this line in the
didFinishLaunchingWithOptionsfunction inAppDelegate, to capture any initial link url:Then, inside the
setMethodCallHandler, as long as it passes the existingguardstatement (the "initialLink" method check), return a result with this initialLink value.