Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apple-app-site-association is not working

I have implemented apple-app-site-association for deep linking with my iOS app.
I have created the .JSON file without extension and placed to my website's root directory.
Now, I can see the file as https://example.com/apple-app-site-association on any browser.

Following is the json body inside the apple-app-site-association file -

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "AppID.bundleIdentifier",
                "paths": [ "*"]
            }
        ]
    }
}

FYI I have added following inside my website's(angular.js) .htaccess -

<FilesMatch "^apple-app-site-association$"> ForceType application/json </FilesMatch>

I have already enabled the "Associated Domain" in both Xcode and developer.apple.com.
But, when I am trying to install a new build, its not working.
By digging into the device log, I am getting the following error.

Please take look and assist me about what I am doing wrong.

[SWC] ### Bad apple-app-site-association JSON: Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}

like image 706
onCompletion Avatar asked Oct 07 '16 14:10

onCompletion


People also ask

How do I get Apple App association?

To associate a website with your app, you need to have the associated domain file on your website and the appropriate entitlement in your app. The apps in the apple-app-site-association file on your website must have a matching Associated Domains Entitlement .

Is Apple-App-site-Association cached?

The apple-app-site-association file is cached once when the app is first installed. If this initial scrape fails, in almost all situations it will not be reattempted. The only exception to this is if the initial return is a 5xx error, in which case a limited number of retries may occur.

What is an AASA Apple-App-site-Association file?

The AASA (short for apple-app-site-association) is a file that lives on your website and associates your website domain with your native app. In other words, it's a safe way to prove domain ownership to iOS.


1 Answers

The file is appropriately hosted, as confirmed by using:

curl -I https://pravin-dev.slicepay.in/apple-app-site-association

You can also use Apple's Applebot to crawl your site to validate an apple-app-site-association. However, this only full verifies if your app is live.

The issue may not be with your association file. You should verify your app is indeed checking https://pravin-dev.slicepay.in/apple-app-site-association and not https://slicepay.in/apple-app-site-association. Double check your applinks in the Associated Domains section of your Capabilities, and the .entitlements file was properly generated. You are using the pravin-dev subdomain - if this was not specified your app may not be looking in the correct location.

As you may know you have to uninstall the app to re-check for the apple-app-site-association.

Ensure capabilities includes subdomain Ensure entitlements file was set properly

like image 141
bradkratky Avatar answered Dec 31 '22 13:12

bradkratky