Clicking on the dynamic link pasted in Notes is not opening the app when the app is installed through xcode. It opens safari every time and lands on the preview page, clicking open button will direct me to app store.
Here are the things that I've done:
applinks:example.page.link in capabitilies tabUPDATE
Found out that AppId Prefix is not equal to Team ID and the aasa file is showing "appID":"[TEAM_ID].[BUNDLE_ID]". Should it be using app prefix instead of team ID?
Below are the codes for reference
func application(_ application: UIApplication, continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
let handled = DynamicLinks.dynamicLinks().handleUniversalLink(userActivity.webpageURL!) { (dynamiclink, error) in
guard error == nil else {
print("Error: \(error!.localizedDescription)")
return
}
if let dynamicLink = dynamiclink {
self.handleDynamicLink(dynamicLink)
}
}
return handled
}
@available(iOS 9.0, *)
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool {
return application(app, open: url,
sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
annotation: "")
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
if let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) {
if dynamicLink.matchType == .unique {
handleDynamicLink(dynamicLink)
}
return true
}
return false
}
Changed Team id to app prefix in firebase settings and it works.
Changed Team id to app prefix in firebase settings and it works.
are you sure this change was how your issue was resolved?
The team I work with solved this by adding the URL prefix /{ your_dynamic_links_domain} to the Associated Domains of our iPhone app as laid out in the Firebase Dynamic Links documentation.
For future reference, if anyone stumbles upon this, DO NOT change the Team ID setting to your App ID Prefix blindly, as this will break Cloud Messaging when used with the Auth Key (ref: https://github.com/firebase/quickstart-ios/issues/381).
I have filed a ticket through the "proper" support channels to bring back the App ID Prefix field to the Firebase Console App Settings page. It seems the Team ID field was titled App ID Prefix earlier and only the title was changed when in reality we need both of these fields to support the combination:
EDIT: If you are developing a legacy iOS app, you should consider migrating the App ID Prefix to the Team ID as per this Technical Note: https://developer.apple.com/library/archive/technotes/tn2311/_index.html
@tsilvone you are the best with this answer. Finally, it's working.
Why not support BOTH Team ID and App Id Prefix.
For dynamic linking that are both auto-generated or otherwise, we need App ID, but for cloud messaging we need Team ID.
There must be something under the hood that is causing such confusion about what to do...allow modifying them both, please! I am considering migrating to an entire new app to avoid the pain this is causing.
Most helpful comment
For future reference, if anyone stumbles upon this, DO NOT change the Team ID setting to your App ID Prefix blindly, as this will break Cloud Messaging when used with the Auth Key (ref: https://github.com/firebase/quickstart-ios/issues/381).
I have filed a ticket through the "proper" support channels to bring back the App ID Prefix field to the Firebase Console App Settings page. It seems the Team ID field was titled App ID Prefix earlier and only the title was changed when in reality we need both of these fields to support the combination:
EDIT: If you are developing a legacy iOS app, you should consider migrating the App ID Prefix to the Team ID as per this Technical Note: https://developer.apple.com/library/archive/technotes/tn2311/_index.html