littlecharva
littlecharva

Reputation: 4244

Xamarin Universal Linking not requesting apple-app-site file

I'm trying to implement Universal Linking in my iOS Xamarin app. I've uploaded the apple-app-site-association file to my server, sending it as application/json and tested to ensure it downloads.

I've then added the following to the Entitlements.plist:

<dict>
    <key>com.apple.developer.associated-domains</key>
    <array>
        <string>applinks:mydomain.com</string>
        <string>applinks:*.mydomain.com</string>
    </array>
</dict>

I need the linking to work across all subdomains, so my understanding is to include both the root domain and the wildcard entry, hence the two entries above. The apple-app-site-association file is served from the root domain and all subdomains.

I'm testing my app in debug mode through Visual Studio, to an actual device (iPhone XS). My understanding is that when the app is installed it will attempt to download the apple-app-site-association file from the server, however, when I check my server logs, there is no record of that happening.

I've tried deleting the app from the phone, re-building and running again, but no joy.

I've tried accessing the apple-app-site-association file using a browser and it loads, and the server logs show that it was requested.

Clearly the reason my Universal Linking isn't working is that my app never requests this file, but I'm at a loss now to understand why.

Upvotes: 0

Views: 858

Answers (1)

nevermore
nevermore

Reputation: 15796

Steps to Setup universal links in Xamarin iOS:

  1. Upload the apple-app-site-association file to the root of your website or in the .well-known subdirectory and make sure it’s served via HTTPS

    1.1 If it’s served via HTTPS and you don’t need to target iOS8, don’t bother trying to sign the JSON file. A plain simple JSON file will do.

  2. Enable the “Associated Domains” functionality in the Apple Developer Center for your app and regenerate the provisioning profile

  3. Add the domain(s) you want to add universal linking for to your iOS Entitlements file in the section “Associated Domains

  4. Make sure to add the applinks: prefix (ex. applinks:ctcode.wordpress.com) Implement the logic in the AppDelegate class

Refer: universal links and universal-links-in-ios

Upvotes: 1

Related Questions