Compaq LE2202x
Compaq LE2202x

Reputation: 2386

Does iOS Universal Link work with website redirections?

I have completed the setup of iOS Universal Links from official Flutter guide. Including hosting the AASA file in my server's /.well-known/apple-app-site-association:

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "ABC123.com.test.test",
        "paths": [
          "/test/*"
        ]
      }
    ]
  }
}

So my URL works if I click it from my Notes or Slack app.

Or if I run in my terminal:

xcrun simctl openurl booted https://<domain.com>/test

For example, <domain.com>/test?response_type=token&client_id=abc123...

There are a couple of redirections in my web app when I click a button, at certain point it calls the said URL with /test path. So my problem is it doesn't automatically open the app through that redirection.

Moreover, ONLY in Safari browser, will a banner that says Open in the Test app.

I understand that it doesn't work if I manually input that URL in the browser address bar.

But does Universal Link's nature, work only when clicked or am I missing anything?

Upvotes: 0

Views: 70

Answers (1)

Compaq LE2202x
Compaq LE2202x

Reputation: 2386

After my extensive research, I found out that for Universal Link to work, it requires an explicit action from the user.

When a user browses your website in Safari and taps a universal link in the same domain, the system opens that link in Safari, respecting the user’s most likely intent to continue within the browser. If the user taps a universal link in a different domain, the system opens the link in your app.

None worked:

  1. Created an invisible button that auto-clicks as the page is loaded
  2. Attempted server side 301 redirection

Therefore, I created a landing page with a button that when clicked would open my app.

References:

  1. https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links#Test-universal-links-behavior
  2. https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links#Use-universal-links-on-your-site
  3. https://help.branch.io/developers-hub/docs/ios-universal-links#apps-limited-by-apple

Upvotes: 0

Related Questions