I am developing an app with xamarin. And i cant get the iOS app to open via a link (universal links) in safari or from the email client. Can someone tell me what i am possibly doing wrong?

I am using:

  • Visual studio 2019 (updated) on windows
    • I have enabled auto provisioning
  • Renting a mac via macincloud for compiling the sources (bigSur)
  • Testing on a iPad what the latest iOS14

In the Entitlements.plist I've added:

<?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>keychain-access-groups</key>
    <array>
        <string>$(AppIdentifierPrefix)com.redacted.redacted</string>
    </array>
    <key>com.apple.developer.networking.wifi-info</key>
    <true/>
    <key>com.apple.developer.associated-domains</key>
    <array>
        <string>applinks:mydomain.nl</string>
        <string>applinks:*.mydomain.nl</string>
    </array>
</dict>
</plist>

Where mydomain is a valid domain of course. I have tried ?mode=developer, but my domain is publicly accessible so this should not be needed. Also i can't put my iPad to developer mode, because i am on windows.

On the websever I've added a .well-know folder with the apple-app-site-association with the following:

{
    "applinks": {
        "apps": [],
        "details": [{
            "appID": "redacted.com.redacted.redacted",
            "components": [

                {
                    "/": "/verify_email/*",
                    "comment": "Matches any URL whose path starts with /verify_email/"
                }
            ],
            "paths": [
                "/verify_email/*"
            ]
        }]
    }
}

"components" for iOS 14 and up "paths" for devices prior to iOS 14

The https://branch.io/resources/aasa-validator/ validates all successfully:

Your domain is valid (valid DNS).
Your file is served over HTTPS.
Your server does not return error status codes greater than 400.
Your file's 'content-type' header was found :)
Your JSON is validated.

I have the feeling that i am missing something. Enabling URL types works like a charm. But i don't like to use urls like myapp://mydomain.nl/verify_email/abcd

Thanks in advance!

Nick

[edit1]

Filter in the devicelog on 'swcd' gives me the following error: Time Device Name Type PID Tag Message Jul 26 16:26:00 iPad-van-Nick Error 233 swcd Error getting enterprise-managed associated domains data. If this device is not enterprise-managed, this is normal: Error Domain=SWCErrorDomain Code=1701 "Failed to get associated domain data from ManagedConfiguration framework." UserInfo={NSDebugDescription=Failed to get associated domain data from ManagedConfiguration framework., Line=298, Function=<private>}

1

There are 1 best solutions below

7
Cheesebaron On

I recently wrote a blog post about this if you are interested: https://blog.ostebaronen.dk/2021/04/ios-applinks.html

What I struggled with is the contents of the apple-app-site-association file, where Apple doesn't provide a JSON schema to validate its contents. I tried several formats that they also provide in the docs, in the end I got it working with the following content:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "<app id prefix>.<bundle id>",
                "paths": [ "/pin/*"]
            }
        ]
    }
}

This works for a URL that matches something like: https://trackman.com/pin/123456. Also, ensure your appID matches your App.

The format with components and paths didn't work for me at all.