Closed DmitryGaimaldinov closed 1 month ago
Related Issue: https://github.com/llfbandit/app_links/issues/36
Thanks for the report. There's an attempt here https://github.com/llfbandit/app_links/tree/macos_uni This is latest version 6.0.2 plus universal link (untested) support on macOS. Feedback appreciated!
Thank you very much for such a rapid response! I've tested this but unfortunately universal link still just opens an application and the link is not handled by flutter. It seems to me there has to be NSUserActivityTypeBrowsingWeb handling https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app. This is done in IOS codebase of this plugin and, maybe, we have to add the same for macos
My pubspec.yaml:
app_links:
git:
url: https://github.com/llfbandit/app_links.git
ref: macos_uni
Can you ensure that your setup is correct from outside the app by using swcutil
? (doc).
If this is OK, you can try with new commits on same branch. You'll have to add this in your own macOS AppDelegate (plugins don't have access to it like on iOS...):
public override func application(_ application: NSApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([any NSUserActivityRestoring]) -> Void) -> Bool {
guard let url = AppLinks.shared.getUniversalLink(userActivity) else {
return false
}
AppLinks.shared.handleLink(link: url.absoluteString)
return false
}
Related Flutter issue: https://github.com/flutter/flutter/issues/148233
Thank you so much, everything works with this setup! The only additional line of code for macos AppDelegate is import app_links
(for future readme update). So full code is:
import app_links
public override func application(_ application: NSApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([any NSUserActivityRestoring]) -> Void) -> Bool {
guard let url = AppLinks.shared.getUniversalLink(userActivity) else {
return false
}
AppLinks.shared.handleLink(link: url.absoluteString)
return false
}
It would be nice to have same support on Windows. I'm ready to help cuz it's a quite priority task in my job now
Released in 6.1.0.
Describe the bug
I make an application which supports Android, IOS, MacOs and Windows. Universal links https://... work perfectly fine on Android and IOS but don't work for MacOS. They just open an application but it feels like there's not handler for the universal link. At the same time app links customScheme://... work on MacOS. I test everything after making a dmg and installing it.
I wish to know if this plugin supports universal links in MacOs. Because even in readme there's only example with custom app links scheme.
My code:
Info plist:
DebugProfile.entitlements and Release.entitlements:
apple-app-site-assiciation also set up correctly because IOS universal linking works.
flutter doctor
Does it related to
[X] App Links (Android)
[X] Deep Links (Android)
[X] Universal Links (iOS)
[X] or Custom URL schemes? (iOS)
Does the example project work?
[V] Yes
[ ] No
[ ] Irrelevant here
Did you fully read the instructions for the targeted platform before submitting this issue?
Uploaded your files to webserver, HTTPS, direct connection, scheme pattern setup, ...
[V] Yes
[ ] No
[ ] Irrelevant here