Update 18.02.27

Universal Link was also jammed with microenvelopes. See MONOsodium glutamate god’s blog: juejin.cn/post/684490…


The Universal link profile

Apple’s official document links: developer.apple.com/library/con…

Universal links is a seamless jump that apple introduced with iOS9.

The official introduction is as follows:

“When you support universal links, iOS users can click a link to your website and seamlessly redirect to an installed app without going through Safari. If your application is not installed, click the link to your website to open your website in Safari.

Generic links have the following advantages over custom URL schemes:

Unique.Unlike Custom URL Schemes, generic links are not declared by other applications because they link to your site using standard HTTP or HTTPS.

Security.When a user installs your app, iOS verifies the file you upload to the site to make sure your site allows your app to open URLs on its behalf. Only you can create and upload this file, so the association between the site and the app is secure.

Flexible.If your application is not installed, the common link will work fine. When the application is not installed, it will be opened in Safari as expected.

Simple.A URL can be used by both a website and an app.

Private.Other apps communicate with your app without knowing whether your app is installed or not.”

(url:developer.apple.com/library/con…).

Creating common links

This can be done according to the official document, or refer to the following link:

Dev. Branch. IO/getting – sta…

Strivingboy. Making. IO/blog / 2015/0…

The state of universal links

Status:

1. Currently, our app supports universal links, but we cannot directly jump to our app from wechat.

2. The universal link fails after a period of use.

3. As for the failure of universal links of all apps occasionally found on some mobile phones, WE have asked apple developers, but have not received any response so far.

Problems solved:

1. Unable to jump in wechat

Because the domain of the jump in wechat was the same before, it was impossible to jump to our application from wechat.

Do as follows:

A. Open a webpage with the URL https://a.xxx.com/zzz in wechat

B. Click the button of the common link on the web page. The common link is a.xxx.com/yyy

It will be found that the jump fails and the page is still open in the wechat webpage.

Change the generic link in step B to b.xxx.com/yyy and click open to jump to our app.

Here’s apple’s official explanation:

“When a user is browsing your website in Safari and they tap a universal link to a URLin the same domainAs the current webpage, iOS Respects the user’s most likely intent and opens the link in Safari.If the user taps a universal link to a URL in a different domain, iOS opens the link in your app.”(url:Developer.apple.com/library/con…)

That is, if a user jumps to the same domain, the iOS system will assume that the user is more inclined to jump to the web page, so it will not jump to the corresponding application.

2. The universal link fails after a period of use

Cause: After using the general link to jump to our application, click the xxx.com button on the right of the status bar, and the general link is invalid.

Clicking this button will be considered by iOS to disable the ability to open the URL with the app. So you can’t open the URL later using the app.

Solution: Open the URL in Safari and scroll down to see the banner shown below. Click the Open button on the right to restore it.

Here’s apple’s official explanation:

“When a user taps a universal link that you handle, IOS also defeats the user’s recent choices to determine whether to open your app or your website. For example, a user who has tapped a universal link to open your app can later choose to open your website in Safari by tapping a breadcrumb button in the status bar. After the user makes this choice, iOS continues to open your website in Safari until the user chooses to open your app by tapping OPEN in the Smart App Banner on the webpage.”

(url:Developer.apple.com/library/con…)

Some unresolved questions:

Symptom: After some devices are restarted, the common link fails

1. Why does the universal link fail after the device is restarted?

After some devices are restarted, the apple-app-site-association file is lost. As a result, urls cannot be associated with applications. This causes the common link to fail.

2. Why is the apple-app-site-Association file lost?

The apple-app-site-association file loss is a system-level problem and has no clear explanation.

3. Will apple-app-site-Association files be downloaded again?

Apple will only request a download to verify the file when the app is installed.

“When the app is installed, the system downloads and verifies the site association file for each of its associated domains. If the verification is Successful, the app is associated with the domain. “(URL:Developer.apple.com/reference/s…)

In addition, there areguessThis file is also requested to be downloaded when an update is applied.

(see: forums.developer.apple.com/thread/3017… , forums.developer.apple.com/thread/6972)

4. Can the common links of other applications take effect when this common link fails?

Due to the small sample size, as observed so far, failure after a device restart causes common links for all applications to fail.

5. Is there a solution?

Deleting and re-installing apps can fix this, but there is no official explanation for it.

In stackFlow (stackoverflow.com/questions/3…). And apple developer BBS (forums.developer.apple.com/message/156…). Has a similar question, has not been answered. We are paying attention.