I’ve followed apple documentation and flutter documentation. When I go to my web page, I see this banner at the top of it:
However, I’d like the functionality of
How can I do it? What is the difference between the deep linking I have done and the popup deeplink?
There are two ways to deep link:
Basic Deep Links
This displays the popup. This method will allow anyone with the app installed to link to your app: com.myapp://
or com.myapp://?q=
.
To do this:
- Add this to your IOS
Info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.myapp</string>
<string>com.another.app</string>
</array>
</dict>
</array>
- You don’t need to add any query params for IOS, it’ll just be captured in the app.
- Run the app and enter
com.myapp://
into Safari, and it will present the popup.
Deferred Deep Links
This displays the banner. This method will allow anyone to open the app. If the app isn’t installed, it will link to the App Store
To do this:
- Complete the steps at the apple documentation. Make your
apple-app-site-association
Ex:
{
"applinks": {
"details": [
{
"appIDs": [ "TEAM_ID.com.bmin-schreib.thePushApp" ],
"paths": [
"*"
],
"components": [
{
"/": "/pushapp/*",
"?": { "invite": "????" }
},
{
"/": "/pushapp"
}
]
}
]
},
"webcredentials": {
"apps": [ "TEAM_ID.com.bmin-schreib.thePushApp" ]
}
}
-
Place this file such that you can reach it by typing in
https://<DOMAIN>/.well-known/apple-app-site-association
. Test this yourself. In my Sveltekit project, I placed this in thestatic
folder to get this to work. DO not name this apple-app-site-association.json -
Once you’ve added the associated site in Xcode
Runner -> Signing & Capabilities -> +Capability -> applinks:domain.com and webcredentials:domain.com
also add an alternate link because Apple CDN will take up to 24 hours to process. Do this by:
Runner -> Signing & Capabilities -> +Capability -> applinks:domain.com?mode=developer
-
Now, on your iPhone, enable developer mode, enter Settings, enter Developer, and enable Associated Domains Development
-
Lastly, use the Diagnostics tool under Associated Domains Development. Try your link, ex domain.com/ and see if apple is able to get your deferred deep link.