Closed samarthagarwal closed 6 months ago
Thanks for the report.
I bet that overriding application(launchOptions:)
conflicts with the plugin.
Depending of what type of link you use here's a sample code that should fix your situation:
// Custom URL
if let url = launchOptions?[UIApplication.LaunchOptionsKey.url] as? URL {
// add eventually a check for your scheme before the lines below
super.application(application, didFinishLaunchingWithOptions: launchOptions)
// force return true so that it is handled in application(_:open:options:)
return true
}
// Universal link
else if let activityDictionary = launchOptions?[UIApplication.LaunchOptionsKey.userActivityDictionary] as? [AnyHashable: Any] {
for key in activityDictionary.keys {
if let userActivity = activityDictionary[key] as? NSUserActivity {
if let url = userActivity.webpageURL {
// add logic for universal link
}
}
}
}
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
This should be somehow available in app_links 3.5.0-beta.1. Please have a look to the README file. Feedback appreciated!
Released in v3.5.0. Update your specifics to catch links.
I am using Flutter add-to-app to add flutter as a module to an iOS app. I have used the plugin to get the initial link and the stream updates as well. Here is the basic code.
I am using the
allStringLinkStream
method to listen to the new links but I never get any updates. The app launches but the link is never received so the app stays on the root URL.Here is some of my iOS code that I am using to render the Flutter app inside the iOS SwiftUI app.
I have also added the required entries to
info.plist
file as well and the custom scheme is registered. Whenever I try to open a custom scheme url, it launches the app but never receives the link information in the Flutter code.