I'm using Qt creator to build an iOS, iPadOS Qt app. I'm following this Apple documentation to associate Universal links to my app.
I placed the apple-app-site-association file in the .well-known directory as documented.
// Note: The Team ID and the app bundle identifier are correct. I printed the bundle ID programatically and pasted here.
{
"applinks": {
"details": [
{
"appIDs": [ "<Team ID>.<bundle identifier>" ],
"components": [
{
"comment": "Match any url (testing)"
}
]
}
]
}
}
This is in the website side.
In the app side, I have set the associated-domains key as follows
// file name - IOSQtLaunchUsingLinks.entitlements
// Note: If my website's URL is https://sample.github.io, I pasted 'sample.github.io' in place of '<website>' below.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:<website></string>
</array>
</dict>
</plist>
This entitlement file is set using CMake as follows:
set_target_properties (appIOSQtLaunchUsingLinks PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "info.plist.in"
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "IOSQtLaunchUsingLinks.entitlements"
)
The above steps worked in a native iOS project - If I click my website link, the app launches. But in a Qt iOS project created using CMake, clicking the website link always launches the website and not the app.
Not sure what have I missed. Please help.