1

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>}

nick
  • 11
  • 3

1 Answers1

0

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.

Cheesebaron
  • 24,131
  • 15
  • 66
  • 118
  • I've tried a few formats. I red that using paths is the 'old' way. The docs describe that i need to use components. I tried using paths first to later find out that it was changed with iOS 14. So I've tried using components and the combined variant you see above. https://developer.apple.com/documentation/xcode/supporting-associated-domains The appID and bundle_id (connected with the dot) was copied from the identifier page in developer.apple.com Do you know if i can check swcd (or its output) when using windows? – nick Jul 26 '21 at 13:57
  • In the device log, filtered 'swcs' and saw this error: Time Device Name Type PID Tag Message Jul 26 16:06:25 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=} – nick Jul 26 '21 at 14:08
  • Do you perhaps have a robots.txt file that disallows the Apple bot? See: https://stackoverflow.com/a/59308939/368379 – Cheesebaron Jul 26 '21 at 20:05
  • No i don't. If i fill in my subdomain.domain.nl to check https://search.developer.apple.com/appsearch-validation-tool the robot can crawl. I see i get the error `Link to Application Action required Could not extract required information for application links. Learn how to implement the recommended Universal Links. Error no apps associated with url` but i think this is because the app isn't published yet? – nick Jul 27 '21 at 06:09
  • I am not sure that tool works at all. Because I have Universal App Links working in a couple of Apps and that tool says gives the same error for those domains. – Cheesebaron Jul 27 '21 at 12:50
  • I thought so. Reading a lot about these issues and this seems to be the case. Because i am using a subdomain, i have the suspicion that i need to install the apple-app-site-association on the master domain as well. So later this day i am moving my webserver and will investigate this problem further. I tink i have tried al combinations possible at the moment. – nick Jul 27 '21 at 12:56
  • Sadly that did not matter. I removed all certificates, profiles, identifiers, installed the apple-app-site-association file in to the root of the server so the domain without a subdomain and the www. subdomain have the file also. – nick Jul 28 '21 at 05:47