Support for one domain in two different applications that support universal links ..?

I have an application that supports universal links and is currently in the application store.

Say that it supports the domain www.example.com, and thus universal links can be easily opened with this. We will have applications: www.example.com in related domains.

Now tell me if I want to free another application, and also supports the same domain. Now, how does iOS distinguish which application opens via universal links ..?

+6
source share
3 answers

I found a solution, but pretty simple. My problem was that my first application supported all pages by specifying

"*" in the path section of the apple-app-site-association file. Now all I have to do is add NOT before one of the paths that I wanted my second application to process.

like "NOT / cab". I have not tested it if it works or not. I will send an update as soon as this is done.

+2
source

To support Universal Links with the same domain in two different applications, you need to make changes to the existing apple-app-site-association file at https: // {domain} / apple-app-site-association.

To support one application

To support one application, it looks like

 { "applinks": { "apps": [], "details": [ { "appID": "1234ABCDE.com.domain.myapp", "paths": ["*"] } ] } } 

Multiple Application Support

To support multiple applications, you need to add another key-value pair to the details applinks in apple-app-site-association . It looks like

 { "applinks": { "apps": [], "details": [ { "appID": "1234ABCDE.com.domain.myApp", "paths": ["*"] }, { "appID": "1234ABCDE.com.domain.mySecondApp", "paths": ["*"] }, { "appID": "1234ABCDE.com.domain.myThirdApp", "paths": ["*"] } ] } } 

Common file format apple-app-site-association

The file is as follows:

 { "applinks": { "apps": [ ], "details": [ { "appID": "{app_prefix}.{app_identifier}", "paths": [ "/path/to/content", "/path/to/other/*", "NOT /path/to/exclude" ] }, { "appID": "TeamID.BundleID2", "paths": [ "*" ] } ] } } 

References

How to support Universal Links on the application server and install iOS for it?

+12
source

Apple App Site Association sample file

 { "applinks": { "apps": [], "details": [{ "appID": "D3KQX62K1A.com.example.photoapp", "paths": ["/albums"] }, { "appID": "D3KQX62K1A.com.example.videoapp", "paths": ["/videos"] }] } } 

Important: The order of the dictionaries in the array determines the order of the system when searching for a match. The first match wins, allowing you to designate one application for processing the specified paths on your website, and another application for the rest.

Links: https://developer.apple.com/documentation/uikit/core_app/allowing_apps_and_websites_to_link_to_your_content/enabling_universal_links

0
source

Source: https://habr.com/ru/post/1242541/


All Articles