Abilash Bansal
Abilash Bansal

Reputation: 304

How to create apple-app-site-association file for Universal Linking in IOS 9?

I have some problem in creating apple-app-site-association file.I don't know how to create json file without json extentsion and have content type application/json for the same file.I want to use this file without any signing as it doesn't need in IOS 9 but I couldn't able to create the valid apple-app-site-association file.

I have setup everything on my app like associated domains,app delegate method,provisioning profiles.

Here is my code on the backend side:

{
    "applinks": {
      "apps": [],
      "details": [
          {
             "appID": "teamID.bundleID",
             "paths": [ "*" ]
          }
      ]
   }
 }

Upvotes: 9

Views: 9345

Answers (3)

Shourob Datta
Shourob Datta

Reputation: 2072

Open your terminal and type

cd desktop

press return key and then type

touch apple-app-site-association

press return

a file is created without any extension

Upvotes: 11

hhamm
hhamm

Reputation: 1571

Another method is to use file match to match exactly your file and to enforce the required content-type:

add following lines to your .htaccess file:

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

this worked for me.

Upvotes: 14

Daigo Sato
Daigo Sato

Reputation: 215

I added the following to the .htaccess file in the root folder. This is a bit rough, but it worked for me to return the file in application/json

RewriteRule ^apple-app-site-association$ - [env=apple:1]
Header set Content-type application/json env=apple

I was not able to make Universal Link work with iOS9 serving application/json yet. Let me know if you made i work.

Upvotes: 4

Related Questions