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": [ "*" ]
          }
      ]
   }
 }
Mayank Patel
  • 3,868
  • 10
  • 36
  • 59
Abilash Bansal
  • 284
  • 2
  • 13

3 Answers3

14

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.

hhamm
  • 1,511
  • 15
  • 22
11

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

Shourob Datta
  • 1,886
  • 22
  • 30
4

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.

Daigo Sato
  • 215
  • 2
  • 8