Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
545 views
in Technique[技术] by (71.8m points)

ios - Universal link - The domain has some validation issue

Im working on universal link to open the application while tap the url. I am using https server and done all the steps from apple (Apple Doc). But the apple universal link validator show below error,

Your file's 'content-type' header was not found or was not recognized.

enter image description here

The apple-app-site-association file successfully uploaded to server and the file be like below,

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "J2HBF9A3PZ.com.aors.speaku",
                "paths": ["*","/"]
            }
        ]   
    }
}

And apple said no need to sign the apple-app-site-association file whether the domain has https.

If the file is unsigned, it should have a Content-Type of application/json. Otherwise, it should be application/pkcs7-mime.

So my query is how to mention the content type (application/json) in this apple-app-site-association file???

please help me on this. i don't know what it mean exactly.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I just solved this issue myself. I had to logon to my server and go to the directory where the apple-app-site-association file was. In this directory, I had a .htaccess file which I modified to include the following lines:

<Files "apple-app-site-association">
ForceType 'application/json'
</Files>

After doing this, the validation service stopped complaining about the Content-Type.

NOTES:

  • If you don't have a .htaccess file, you can just create one.
  • I presume the .htaccess file should be in the root of your site directory (which is where you would most likely have placed your apple-app-site-association file.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...