简体   繁体   中英

Universal Links - Cordova iOS application

I've trying to achieve universal linking for one of my apps. I've referred to almost all the tickets in stackoverflow but still couldn't make it work for some reason. Below is the process I'm following.

Created apple-app-site-association file and added below content

    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "TEAM_ID.BUNDLE_ID",
                "paths": [ "*" ]
            }
        ]
    }
}

Uploaded this file to 'public' folder in source code. Also changed the content-type to json in nginx configuration.

location /apple-app-site-association {
    default_type application/json;
}

When I run this command in terminal it shows that content-type is changed to application/json. Below is the reference. curl -I http://ec2-34-201-173-250.compute-1.amazonaws.com:8080/apple-app-site-association Output is below:

HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu)
Date: Thu, 18 Nov 2021 11:39:43 GMT
Content-Type: application/json
Content-Length: 192
Last-Modified: Mon, 15 Nov 2021 09:46:17 GMT
Connection: keep-alive
ETag: "61922c69-c0"
Accept-Ranges: bytes

Also when I click on the link , it opens the apple-app-site-association json without any problem.

But for some reason apple-appsearch-vaidation-tool fails with below response

Link to Application
Action required
Could not extract required information for application links. Learn how to implement the recommended Universal Links.
Error cannot fetch app site association

More Info: Its a HTTP domain - Not sure if I need to upload the signed apple-app-site-association file.

Please help me with this issue.

Thanks in-advance.

According to the Apple documentation, you should upload your apple-app-site-association on an server that support HTTPS valid protocol, additionally they specific that the file should be on the /.well-known folder, I share with you the useful link about that:

https://developer.apple.com/documentation/xcode/supporting-associated-domains

On the other hand, to validate that you apple-app-site-association file is correctly hosted you can use the branch.io validator for AASA file using the following link:

https://branch.io/resources/aasa-validator/#resultsbox

I validated your apple-app-site-association file and the branch.io validator shows the following:

在此处输入图像描述

If you have problems with the SSL for your server, maybe you can use Firebase Hosting for that, this tool give you an free domain with HTTPS configured, and the host to save the apple-app-site-association file, if you use this take in mind that the possible configuration for the firebase.json file would be:

{
  "hosting": {
    "public": "public",
    "headers": [
      {
        "source": "/apple-app-site-association",
        "headers": [{"key": "Content-Type", "value": "application/json"}]
      }
    ],
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "appAssociation": "NONE"
  }
}

And the Firebase project folder would have a scaffold-like this:

在此处输入图像描述

Regards!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM