2. Universal and App Links

Contents

linkWhat happens to existing links?

linkIf your links use the legacy bnc.lt domain

Universal Links are of the form https://bnc.lt/«four-letter-identifier»/«link-hash». Existing links created prior to enabling Universal Links are of the form https://bnc.lt/m/«link-hash» or https://bnc.lt/l/«link-hash» and will continue to function as non-Universal Links.

Aliased links on the bnc.lt domain (e.g., bnc.lt/download) are not compatible with Universal Links.

linkIf you use a custom domain or subdomain

Branch links with custom domains are always enabled for Universal Links, even if generated prior to when you enable the feature.

linkApps/browsers that support Universal Links

Unfortunately Universal Links don’t work everywhere yet. We have compiled the Universal Links support status of some of the more popular apps.

linkApps that always work

If you open a Universal Link in one of these apps, it should work correctly all the time.

App/Browser Status
Messages works
Mail works
WhatsApp works
Gmail works
Inbox works

linkApps limited by Apple

Apple has limited Universal Links in certain situations, apparently to avoid confusing users:

  • Universal Links will not work if you paste the link into the browser URL field.
  • Universal Links work with a user driven <a href="..."> element click across domains. Example: if there is a Universal Link on google.com pointing to bnc.lt, it will open the app.
  • Universal Links will not work with a user driven <a href="..."> element click on the same domain. Example: if there is a Universal Link on google.com pointing to a different Universal Link on google.com, it will not open the app.
  • Universal Links cannot be triggered via Javascript (in window.onload or via a .click() call on an <a> element), unless it is part of a user action.
App/Browser Status
Safari works conditionally
Chrome works conditionally

linkApps that work sometimes

Apps with built-in webviews (Google, Twitter, Facebook, Facebook Messenger, WeChat, etc.) work with Universal Links only when a webview is already open. In other words, Universal Links do not work in-app from the feed or main app views.

To work around this limitation, your links must have deepviews or something similar enabled, with a call-to-action link/button that has a Universal Link behind it. This way, clicking a link from the app feed will open a webview containing your deepview page, and the user can then click the link/button to launch your app. All of Apple’s limitations (in the section above) still apply for the deepview page.

App/Browser Status
Google works conditionally
Facebook works conditionally
Facebook Messenger works conditionally
WeChat works conditionally
Twitter works conditionally
LinkedIn works conditionally
Any app using SFSafariViewController works conditionally

linkApps with special cases

App/Browser Status
Slack works if configured to open links in Safari. Otherwise, works conditionally as in the above section.

linkApps that do not work

App/Browser Status
Pinterest broken
Instagram broken
Telegram broken

linkLinks with custom labels/aliases

Example Link Domain/Subdomain Link Alias Universal Links Support
bnc.lt/oTLf/x7daC5fDzs default default Yes
bnc.lt/app-download default custom No
yourdomain.com/oTLf/x7daC5fDzs custom default Yes
yourdomain.com/app-download custom custom Yes

linkUsing the bnc.lt domain

When a Universal Link is opened, iOS searches for any app on the device that has registered to handle that URL. Because the bnc.lt domain is used by hundreds of apps, Branch appends a unique four-letter identifer (i.e., mGmA) that ties links to the correct app. Links with custom labels/aliases (i.e., bnc.lt/yourapp) do not have this four-letter identifier, so these links are incompatible with Universal Links.

linkUsing a custom domain or subdomain

Custom domains and subdomains are unique to your app and not shared. All links on a custom domain or subdomain are compatible with Universal Links, including those with link labels/aliases (i.e., yourdomain.com/yourapp).

linkTroubleshooting Universal Links

Automated Validation for Your Xcode Project

You can check if your Xcode project is correctly configured by using our Universal Links Validator.

linkAre you testing by manually entering into Safari?

Universal Links don’t work properly when entered into Safari. Use Notes or iMessage for testing.

linkAre you wrapping Branch links with another link and redirecting?

In most cases, Universal Links won’t open the app when they are “wrapped” by click tracking links. Universal links, including Branch links, must be freestanding. If you want Universal Links to work in all situations, do not use other links that redirect to your Branch links.

linkDo your Team ID & Bundle ID match those on your dashboard?

You can find them in the Dashboard under Settings > Link Settings, in the iOS section next to “Enable Universal Links.” They should match your Team ID and Bundle ID. Team ID can be found here https://developer.apple.com/membercenter/index.action#accountSummary. Your Bundle ID is found in Xcode, in the General tab for the correct build target. If your Apple App Prefix is different from your Team ID, you should use your App Prefix. Your app prefix can be found from App IDs on Apple’s Developer Portal.

linkHave you deleted the app and reinstalled it?

iOS does not re-scrape the apple-app-site-association file unless you delete and reinstall the app. (The only exception to this is App Store updates. iOS does rescrape on every update. This means that when users update to a version of your app with the applinks entitlement, Universal Links will start working for them.)

linkUniversal Links can be disabled, unfortunately.

If you are successfully taken into your app via a Universal Link, you’ll see “bnc.lt” (or your domain) and a forward button in the top right corner of the status bar. If you click that button, Apple will no longer activate Universal Links in the future. To re-enable Universal Links, long press on the link in Messages (iOS 9 only due to iMessage revamp in 10) or Notes (iOS 10/9) and choose ‘Open in «App»’.

linkUsing a custom domain?

Make sure it’s configured correctly. You can find configuration issues by using our Universal Link Validator.

If you’re using a custom subdomain, your CNAME should point to custom.bnc.lt under Link Settings in the Branch dashboard.

The following error message will appear in your OS-level logs if your domain doesn’t have SSL set up properly:

Sep 21 14:27:01 Derricks-iPhone swcd[2044] <Notice>: 2015-09-21 02:27:01.878907 PM [SWC] ### Rejecting URL 'https://examplecustomdomain.com/apple-app-site-association' for auth method 'NSURLAuthenticationMethodServerTrust': -6754/0xFFFFE59E kAuthenticationErr

These logs can be found for physical devices connected to Xcode by navigating to Window > Devices > choosing your device and then clicking the “up” arrow in the bottom left corner of the main view.

linkUsing Facebook’s SDK?

In certain situations, the Facebook SDK can cause application:didFinishLaunchingWithOptions: to return NO. When this happens, handling for all Universal Links is blocked. Please ensure that application:didFinishLaunchingWithOptions: always returns YES/true.

linkbnc.lt links with your Test Key?

Due to a change in iOS 9.3.1, Universal Links will not work on Test apps using the bnc.lt domain. We’re working on resolving this. Please test Universal Links with your Live app, where they will work as expected. Read more.

linkWhat changed in iOS 9 and 9.2?

Apple introduced Universal Links in iOS 9.0, as an alternative to the conventional method of JavaScript/URL-scheme link routing. Apple made it impossible to use JavaScript/URL-scheme routing beginning with iOS 9.2, leaving Universal Links as the only supported method.

We have published a number of resources that can help you understand the changes and how it impacts your app: