frankWhite
frankWhite

Reputation: 1542

How to properly test Universal links?

I have several questions about Universal links implementation. I read a lot of information from SO/other sources but questions are remain.

At first, I want to say that I correctly configured project (added entitlements, added callback to AppDelegate) and correctly configured AASA with my team id/bundle id (I have a working example from another service).

Quiestion #1.

Is root directory still working location for apple-app-site-association (further AASA) file? How I can check it with SWCD (what kind of message should be)? I found next problem: our site based on WordPress and it's a bit problematic (I'm not familiar with WordPress - only have words of my colleague) to add this file to .well-known directory. So my colleague just added AASA directly to the root directory. But, universal links are not working. I found only one meaningful message from device's logs: (loading AASA file failed) -

Request for '<private>' denied due to HTTP status 404 on route .wk for task AASA-1D53AE3E-9261-413F-B384-20D1DC57B81A { domain: ch….dk?mode=developer, bytes: 0, route: .wk }

Seems like SWCD tries to load a file from non-existing .well-known directory (because of 404 error), but I don't understand is it tries to load a file from root directory.

Also, I tried to run my site through validator - and it failed. From this source - there is no difference using root directory or .well-known directory - they both should work.

OK, let's assume this validator is wrong.

Question #2.

Is it possible to 100% find where the problem exactly? (iOS or backend/site side)

It is not clear how exactly https://search.developer.apple.com/appsearch-validation-tool works. For example, I checked facebook.com.

Results: Link to Application is passed. Universal = true.

I checked instagram.com.

Results: Link to Application - no exact answer. Universal = false.

The results are quite ambiguous.

Anyway, both http://instagam.com/apple-app-site-association and http://facebook.com/apple-app-site-association return valid file and I'm sure universal links are working through their iOS applications.

Question #3.

I checked several AASA files in Postman. I noticed that my AASA file does not contain content-type header. Facebook, Instagram and others contain this header for their AASA files. They all have different values, but they return in responses. Can be it an issue?

Question #4.

Any other ideas? I will be appreciated. I think my issue that iOS system does not recognize AASA file from my site. But I don't have ideas how to fix it now.

Upvotes: 2

Views: 5469

Answers (1)

ealee
ealee

Reputation: 91

Better place "apple-app-site-association" file in ".well-known" folder.

Branch.io and Apple Validator are useless. Better just to validate json.

Use iOS 13 version of "apple-app-site-association" file.

   {
      "applinks": {
          "apps": [],
          "details": [
            {
              "appID": "ABC1234567.co.app.prod",
              "paths": ["/first/*", "/second/*"]
            },
            {
              "appID": "ABC1234567.com.app.dev",
              "paths": ["/first/*", "/second/*"]
            }
          ]
      }
    }

Apple CDN caches "apple-app-site-association" file data. Use developer mode when testing.

<key>com.apple.developer.associated-domains</key>
<array>
    <string>applinks:example.com?mode=developer</string>
</array>

In developer mode app fetches "apple-app-site-association" file data directly from your site.

To test on device in developer mode enable associated domains in settings->development...

Uploaded "apple-app-site-association" file should be with header content-type=application/json.

Don't forget to disable developer mode when finish testing.

Upvotes: 5

Related Questions