AppleDeep LinkingHow TosiOS 9Mobile MarketingTechnicalUniversal Links

How to Set Up Universal Links to Deep Link on Apple iOS

By July 20, 2015 90 Comments

This was originally posted on July 20th, 2015 but has since been updated with the latest information. Now that Apple no longer supports URI schemes for deep linking, developers must implement Universal Links in order to deep link properly on iOS. If you are already using URI schemes, check out our blog on transitioning to Universal Links

At Branch, we eat, breathe and sleep mobile deep linking. We created a single link that you can use everywhere: every platform, every device and every app store to drive users to your app. It’s a single link, fully configured to link to your app off of every channel (Facebook, Twitter, Gmail, etc) and be listed in every search portal (Firebase App Indexing, Bing search, Apple Spotlight).

It just works. In fact, we’ve already written blog posts about How to Set Up Google App Indexing and How to Deep Link on Facebook, check them out.

Slide1

When Apple announced “Universal Links” in the 2015 WWDC pitch, we were excited to incorporate it into the Branch deep linking platform. Little did we know how complicated it would be to get it working. After spending far too much time on it and given how poor the documentation is, we thought we’d share a guide on how to do it in order to save everyone else.

How Do Universal Links Work in iOS?

Before Universal Links, the primary mechanism to open up an app when it was installed was by trying to redirect to an app’s URI scheme in Safari. This put the routing logic in Safari, but there was no way to check if the app was installed or not. This meant that developers would try to call the URI scheme 100% of the time, in the off chance that the app was installed, then fallback gracefully to the App Store when not by using a timer.

Universal Links were intended to fix this. Instead of opening up Safari first when a link is clicked, iOS will check if a Universal Link has been registered for the domain associated with the link, then check if the corresponding app is installed. If the app is currently installed, it will be opened. If it’s not, Safari will open and the http(s):// link will load.

Functionally, it allows you have a single link that will either open your app or open your mobile site.

Universal Link Integration Guide

Here are the high-level steps to get Universal Links working for your app:

1. Configure your app to register approved domains

  1. Register your app at developer.apple.com.
  2. Enable Associated Domains on your app identifier.
  3. Enable Associated Domains on in your Xcode project.
  4. Add the proper domain entitlement.
  5. Make sure the entitlements file is included at build.

If you use Branch, you can stop here. Otherwise, continue to section two.

2. Configure your website to host the apple-app-site-association file

  1. Buy a domain name or pick from your existing.
  2. Acquire SSL certification for the domain name.
  3. Create structured apple-app-site-association JSON file.
  4. Sign the JSON file with the SSL certification.
  5. Configure the file server.

If you use the Branch hosted deep links, we’ll save you all of the complexity of creating SSL certs and signing and hosting your server’s JSON file, so you only need to modify your app’s code to leverage it. We’ll introduce this at the bottom of the post.

Note: We’ve also built a tool to check if your apple-app-site-association file is configured properly.

Section 1: Configuring your app entitlements

Note: newer versions of Xcode can typically handle entitlement provisioning for you automatically. You can most likely skip to the Enable Associated Domains in your Xcode project section below, and refer back to these instructions only if you encounter problems.

In order to register your Xcode project for Universal Links, you need to create an App ID in the Apple developer portal and enable the proper entitlements. This is very similar to the configuration required for in-app purchases.

You cannot use a wildcard app identifier for Universal Links.

Register your app on developers.apple.com

First, head to developer.apple.com and log in. Then click on Certificates, Identifiers & Profiles, and then click on Identifiers.

Apple Developer Portal for Universal LinksApple Dev Portal for Universal Links

If you don’t have a registered App Identifier already, you’ll need to create one by clicking the + sign. If you do have one, skip ahead to the next section.

You need to fill out two fields here: name and bundle ID. For name, you basically enter whatever you want. For bundle ID, you’ll fill in the value of the bundle

Explicit App ID for Universal Links

 

You can retrieve this by looking at the General tab of your Xcode project for the proper build target.

Setting up Universal Links in xcode

Enable Associated Domains in your app identifier on developers.apple.com

For your pre-existing or work-in-progress App Identifier, scroll down to the last section and check the Associated Domains services.

Setting up App ID for Universal Links

 

Scroll down and click Save.

Enable Associated Domains in your Xcode project

Now, you’ll want to enable the Associated Domains entitlement within your Xcode project. First, make sure that your Xcode project has the same Team selected as where you just registered your App Identifier. Then go to the Capabilities tab of your project file.

Universal Links in xcode

Scroll down and enable Associated Domains so that the accordion expands.

setting up associated domain for Universal Links

If you see an error like this, check:

  1. That you have the right team selected.
  2. Your Bundle Identifier of your Xcode project matches the one used to register the App Identifier.

Add the domain entitlement

In the domains section, add the appropriate domain tag. You must prefix it with applinks:. In this case, you can see we added applinks:yourdomain.com.

App Links and your domain

Make sure the entitlements file is included at build

Lastly, for some reason, Xcode 7 did not include my entitlements file in my build. In the project browser, make sure that your new entitlements file is selected for membership to the right targets so that it’s built.

Configuring xcode for universal links

 

If you use Branch links, you can stop here! If not, keep reading or use the button below to start integrating.

If you want to save yourself hours of headache, you can avoid all the JSON hosting and SSL cert work and just use Branch links to host it for you. However, if you’re a control freak and glutton for punishment, by all means continue.

Section 2: Configuring your apple-app-site-association file

Universal Links turn your website URL into an app link, so you need be running a web server in order to leverage them. To help with this process, use our Universal Links Validator to check if your apple-app-site-association file is configured properly.

Pick a domain

First, identify the domain that you’d like to use for your Universal Links. You can register a new one or use an existing. If registering a new one, we prefer to use a clean, non-spammy registrar like gandi.net.

Acquire SSL certification

You need to acquire SSL certification files for the domain you’ll use to host the Universal Links. In order to do this, you’ll need to use a third party service to register your domain for SSL, and create the files you need. After looking around, we’ve chosen Digicert to handle branch.io and associated subdomains.

Here are the steps to create your SSL certification:

  1. Visit https://www.digicert.com/easy-csr/openssl.htm and fill out the form at the top to generate an openSSL command. Keep this window open.
  2. Log into your remote server.
  3. Execute the openSSL command to generate a certificate signing request (.csr) and certification file (.cert).
  4. Pay for your SSL certification at https://www.digicert.com/welcome/ssl-plus.htm.
  5. Wait for Digicert to approve and send you the final files.
  6. In the end, move yourdomain.com.cert, yourdomain.com.key and digicertintermediate.cert into the same directory on your remote server.

Create your apple-app-site-association JSON

There is a pretty standard structure of this JSON file, so you can basically just copy this version and edit it to fit your needs. I’ll break down where to get the correct values below.

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "T5TQ36Q2SQ.com.branch.sdk.TestBed",
        "paths": ["*"]
      }
    ]
  }
}

The only fields you need to change are associated with: T5TQ36Q2SQ.com.branch.sdk.TestBed. This is actually two values joined together with a period. Both values are found on developers.apple.com in the Identifiers -> App IDs section. Just click on the corresponding registered App ID as shown below.

Configuring Apple ID for Universal Links

In this example, connect the Prefix and the ID together with a period so that it looks like so: T5TQ36Q2SQ.com.branch.sdk.TestBed.

Save this JSON file as apple-app-site-association-unsigned.

Sign the JSON file with your SSL certificates

Note: if you have certified your domain as HTTPS, you can skip this step and send the JSON in plaintext, as explained in Apple’s updated requirements:

If your app runs in iOS 9 or later and you use HTTPS to serve the apple-app-site-association file, you can create a plain text file that uses the application/json MIME type and you don’t need to sign it. If you support Handoff and Shared Web Credentials in iOS 8, you still need to sign the file as described in Shared Web Credentials Reference.

All apple-app-site-association files on the Branch platform are now served as unsigned application/json.

Upload the apple-app-site-association-unsigned file to your server into the same directory as the certification and key files from the previous steps. Using the command line, change directory into that folder and issue the following command:

cat apple-app-site-association-unsigned | openssl smime -sign -inkey yourdomain.com.key -signer yourdomain.com.cert -certfile digicertintermediate.cert -noattr -nodetach -outform DER > apple-app-site-association

This will generate the file apple-app-site-association.

Configure your file server

Alright! So you have your signed apple-app-site-association file. Now you just need to configure your file server to host this for you. There are a few caveats:

  1. It must be sent with the header application/pkcs7-mime (or application/json, as noted above).
  2. It must be sent from the endpoint youdomain.com/apple-app-site-association, and/or youdomain.com/.well-known/apple-app-site-association (iOS 9.3+ only).
  3. It must return a 200 http code.

We set up the one for all Branch integrated apps using our Node+Express link servers. Here’s the code we used, in case that’s helpful:

var aasa = fs.readFileSync(__dirname + '/static/apple-app-site-association');
app.get('/apple-app-site-association', function(req, res, next) {
     res.set('Content-Type', 'application/json');
     res.status(200).send(aasa);
});

Branch and Universal Links Integration Guide

Again, as a reminder, you can avoid all the JSON hosting and SSL cert work and just use Branch. Happy Linking!

Branch is a mobile linking platform providing unified mobile experiences and measurement for more than 27,000 mobile apps, including Airbnb, Slack, Reddit, Tinder and Amazon. Branch’s free linking platform can help you grow your mobile app through features like deep linking, sharing, referrals, mobile banners and interstitials, custom app onboarding, and unified attribution across platforms and channels. Learn more about Branch.
  • Paja

    Great article with a lot of valuable insights into this new approach of deep linking in iOS 9! I am testing universal links on Beta 4 and yet getting the issue you explained in the introduction of your article “Instead of opening up the app when installed as described the OS is routing to the web page in Safari and showing the iOS mobile app banner in Safari. ” this banner has an OPEN button, which then opens the app and invokes continueUserActivity. Have you experienced similar issue on Beta 4, eventually how did you solve it?

    My theory is that the OS actually sees that the app is registered (due to domains in associated domains) however for some reason cannot open the app directly (and yes, JSON on the server side is signed)

    • Alex

      Paja – it doesn’t seem to work on Beta 4 unfortunately yet. We’ll let you know as soon as they get it working again!

      • Paja

        Hey Alex, any luck with the new Beta 5? I tried it so far only on simulator and still encountered the same problem as explained above

        • Alex

          We actually have it working in Beta 5. We’re nearly done with all of the backend changes to support Universal Links for all Branch links. You won’t even need to both with the JSON signing stuff – we’ll do that whole server component for you.

  • Jungles13

    Does anyone know what happens if you install the version of the app that supports Universal Links on iOS 8 before upgrading to 9? My understanding is that the association file is downloaded during install. Will the upgrade to iOS 9 trigger a re-download?

    • Alex

      Hey Jungles – You should definitely set up the association file before iOS9 launches. It will work automatically on update then.

      Good luck!

  • John

    Is it possible to test universal links before iOS9 officially released? If yes, how?

    • Alex

      John – it sure is.
      1. Just head to developers.apple.com and download Beta 5.
      2. Add in the bnc.lt Associated Domain to your app as I instruct in this guide (https://dev.branch.io/recipes/branch_universal_links)
      3. Flip on the UL switch on the Branch dashboard.
      4. Then click the link from messages or something. It will open your app directly when installed.

      Careful! After you get Universal Linked, it will show ‘bnc.lt’ in the top right of the screen. If you click that, Universal Links stop working on that device and require a OS reinstall.

      • Nikolay Demyankov

        Opened https://bnc.lt/apple-app-site-association link in the browser – and the content of the file is as you described in this tutorial.

        But according to the apple documentation ( https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html ) format of the apple-app-site-association file should be different. Can it be the reason why UL didn’t work for me? 🙂

        • Alex

          We’ve got a ton of apps using that file without issue unfortunately. Are you using the released version of iOS 9.0? Also, have you done all the previous steps to configure Branch with the bundle identifier and all that on https://dashboard.branch.io/#/settings/link

          Why don’t you send a note to support@branch.io and we’ll help look at your settings.

          • Nikolay Demyankov

            It worked today, sorry for distraction! Just had to launch the app on a real device, not an emulator. It seems that was the issue, because didn’t change anything in the app.

            But still, it’s kind of strange that in apple documentation apple-app-site-association file has one format, but you use the other one and it works. Maybe some backwards compatibility from the Apple. Well, it works and that is all that matters. Thanks for a great tutorial 🙂

          • Alex

            Thanks for sharing your learnings! Happy linking 🙂

  • Dmitry Isakov

    Does anyone know if there is a way to check if a particular app (any app) is installed on ios9? It can be a hack or whatever else algorithm, but I need to know if the app is installed.

  • Maximus McCann
    • Alex

      Hey Max – thanks for pointing this out. I’ll update it this afternoon!

  • Jim

    All I want to do is link to the App Store through Safari without having the “Open in App Store” confirmation dialog. Does anyone know how that is done? the branch.io deep link that was generated for me doesn’t do it: https://bnc.lt/d/tbWfyVcr5n.

    • Alex

      Hey Jim – You can put your Branch links into ‘Don’t try to open the app’ mode by toggling the following switch in your settings. The toggle switch is called ‘Always try to open the app’ and it’s located in your link settings: https://dashboard.branch.io/#/settings/link.

      This puts the links into a mode where we’ll only open up the app if we’ve correctly matched a browser cookie to an IDFA. This happens once you’ve been deep linked correctly, so if you want to test the new user experience, you can clear your cookies. Alternatively, if you never want us to try to open the app, you can append ‘?has_app=false’ to the link.

      Hope this helps!

      • Jim

        Still running into this dialog after tapping in iMessage and redirecting through Safari though, any ideas?

        http://i.imgur.com/U6ShfTz.png

        • Alex

          You can thank Apple for that. They starting popping up modals when you want to send the user to the App Store on 9.1. There’s no way to open the App Store automatically without avoiding the modal in the new version of the OS.

          • Jim

            That’s no fun. I noticed both http://get.vine.co and http://lyft.com both go straight to the app store when tapping from iMessage/email (tho doesn’t work when typing into Safari url bar) – any idea how they are doing it? anything to do with universal links?

          • Alex

            Ah – it seems they are issuing a 3XX redirect to the App Store. This is undocumented functionality, but you can do this with us by appending ‘iframe_src=true’ as a query parameter to the link.

          • Jim

            Wow that works thanks! Do you happen to know why that works on the bnc.it but not when I add that query parameter to my own domain link (that has redirect to app store using window.location = “my itunes link”)?

          • Alex

            Because we built Branch (bnc.lt) to handle over 6000 different edge cases for redirection, with knobs to customize for every case.

          • warpling

            I’m sure you’ve figured it out now, but for future readers it’s .LT not .IT
            Took me forever to notice this.

  • Zeeshan Chughtai

    How we can test all this using localhost, means no ssl certificates ?

  • Ahmed Karmous

    hi 🙂 i’ve added deep link in my ios app and it’s working fine ! the only issue is that when the popup show in safari it’s not showing the app name it’s like open this link in <> ?. i’ve added the url identifier and scheme ! is there something missing here ?

    • Alex

      Hey Ahmed – this was a new ‘feature’ introduced by Apple in Safari for iOS 9. They decided to start showing a modal when the user attempts to open up the app. Unfortunately, there’s no way to get by this if the Universal Link doesn’t trigger. Hopefully they’ll consider removing this in future versions, as it was not present in iOS 7 or iOS 8.

  • sravani

    Hi all I have tried this process, but i am not clear about the whole process. There is a point “SSL access to your domain”. What the app/Web people to do for this. Can any one clearly explain it. I have done all the process upto JSON file creation. and placed in server. But not getting any result. Please help me out from this.
    Thanks in advance

    • Alex

      Hey Sravani – Did you sign the JSON file with your SSL certs with this command? `cat apple-app-site-association-unsigned | openssl smime -sign -inkey yourdomain.com.key -signer yourdomain.com.cert -certfile digicertintermediate.cert -noattr -nodetach -outform DER > apple-app-site-association`

      • sravani

        No..Shall i execute this command in terminal? can you explain what certificate it is “digicertintermediate.cert” in the command?

        • Alex

          When you buy SSL cert for your website, you’ll get yourcertcompany.cert and yourdomain.com.cert. When you execute that command that command in the terminal, you must reference those files.

          • http://edjiang.com/ Edward Jiang

            Hey Alex, you don’t need to sign the apple-app-site-association file if you’re only using deep links:

            https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html

            >If your app runs in iOS 9 or later and you use HTTPS to serve the apple-app-site-association file, you can create a plain text file that uses the application/json MIME type and you don’t need to sign it

          • Alex Austin

            Thanks so much for the suggestion Edward. They must have added this simplification when they updated the JSON structure. I’ll add a note that if you’ve already bought a cert for your domain, you can use a plaintext JSON.

          • sravani

            Don’t mind for the late response. I have completed the deeplinking process few months back. Your suggessions helped me alot.
            Thanks guys for your fast and perfect response… 🙂

          • Mada Seghete

            Awesome! So happy we could help!

          • sravani

            Hi, I have done the deeplinking process. But now I am facing one issue in this. My app is working perfectly when its in background. But the problem is when I kill the app and trying to open from safari, its redirecting to the application, but ‘continueUserActivity’ method is not executing. But when the app is in background, the method is executing fine. Please can anyone suggest why it’s happening…

          • Alex Bauer

            Hi there!

            Are you by any chance also using the Facebook SDK in your app? In order for continueUserActivity to work from a cold start of the app, didFinishLaunchingWithOptions needs to return YES. Some versions of the FBSDK hijack the process and cause didFinishLaunchingWithOptions to return NO (thanks, Facebook…)

            Fortunately the workaround is fairly easy: just put the following line somewhere before your Branch initSession call:

            [branch accountForFacebookSDKPreventingAppLaunch];

            If this isn’t the issue, let me know and we’ll debug further!

          • sravani

            Thank you very much Alex. It’s working fine now. The issue because of Facebook. Now its fine. Thanks alot…

          • Alex Bauer

            Fantastic! Glad to hear it’s all running smoothly now.

          • sravani

            Hi Alex… We have signed JSON file with ssl cert in “https://www.domain.com”. But I have executed “http://www.domain.com/….” path in safari. But its not working. The asssociation file is in “https” but I am executing url with “http” then how it will redirect to app, how will it recognize. Is there any interlink process for this?

          • Alex Austin

            Did you also register the app entitlements for the app? Make sure you’ve registered the correct URL path in the JSON as well, by using the wildcard asterisk.

          • sravani

            Here is my association file data. Check it and let me know whether it is correct or not

          • sravani

            What is the process to Register the app at developers.apple.com?

  • DanteK

    “However, if you’re a control freak and glutton for punishment, by all means continue.”

    Wow. How old are we here? It’s one thing to promote your service. It’s another to try and guilt-trip people into buying your product. You should not be insulting your [potential] customers, even if it’s a joke. It comes across as egotistical, at the very least…

    You may enjoy your sense of humor, but 1) it does not translate well to non-native speakers (remember, most people in the world are not native speakers of English), 2) lowers your image (comes across as a rather juvenile jab/sales tactic) and 3) from the perspective of the reader, did nothing for the article except for make it a couple lines longer than it needed to be.

    I came here and found an informative article, but I must say that you done goofed on that one line, Alex. I hope you can understand where I am coming from and that, even if you delete this comment, it’s a good idea to take it into consideration.

    • Alex

      Sorry you feel that way Dante and I greatly appreciate the input. Let us know how we can help. Happy linking!

  • http://about.me/tg9963 GOPI GOPINATH

    Hi,
    I’ve added the associated domains => applinks:www.domain.com & applinks:domain.com
    when I hit the URL https://domain.com It works fine and opens the app. But when I try to hit https://www.domain.com, Its opening in safari. can someone help me out ?

  • 陳俊甫

    The association file will be requested when first launch app. What if there is not internet accessing when first launch? Does it request the file when device is on-line next time?

    • Alex Austin

      I believe Apple will queue it up on first launch if the internet is not available, and query it on second launch. That’s what we’ve observed in testing. Hope this helps!

      • 陳俊甫

        Hi Alex,
        Thanks for reply.
        I could enable Universal Links if launch app under internet accessing.
        But if I install app and launch it w/o internet at first time, the Universal Links does not work.
        Is there any way to check why?

        • Alex Austin

          At Branch, we host everyone’s Universal Links, so we receive the request for the apple-app-site-association file from Apple every time an app is installed. Unfortunately, if the internet is disabled, there’s no way they can retrieve this file from your or our server and therefore Ulinks can’t work. However, reopening the app later with internet enabled should recover it.

  • Chanh

    On iOS devices, how can I get the marketing link to work (launch the app) when originating from the Twitter or Facebook App? I get a “File not found” on the Twitter app, and takes user to the AppStore on the Facebook app. It works when navigate from Facebook or Twitter on Safari browser. Thanks!

    • Derrick

      Chanh, can you shoot us a note at support@branch.io with the link you’re using to test? Facebook’s news feed does not support Universal Links — they only work once a their webview is open. Twitter is the same way — Universal Links only work once the webview is already open. (Twitter also allows for some, albeit imperfect, use of URIs to open apps from within the webview. Branch makes use of this mechanism as well.)

      It sounds like there may be a configuration issue causing the “File not found” error on Twitter. Again, support@branch.io is probably the best place to work through what is wrong in this case.

  • aimy_ivy

    Hi Alex, I am trying to get universal linking working. I have followed all the steps above but universal liking doesn’t seem to be as seamless for me as I saw it in the WWDC video. Here is the sequence of event:
    1. Upon clicking a link in Gmail I get navigated to Safari.
    2. In Safari I see an alert “Open this Page in ” with options to “cancel” or “open”.
    3. The safari page is displaying information “App Not detected”/ “Get the app”/ “I have the app, try again”
    4. Since I do have the app, I hit “the try again option”
    5. I get the alert “Open page in .

    I repeat steps 4,5 a few more times before I am able to see the link in the app itself.

    Any idea why this might be happening .. ?

  • Ranjan Sahu

    Hi Alex , I am facing a issue with Universal deep linking. When i am clicking a link from Note, Skype and Mail its redirect through Safari.

    I have followed all the provided document but its not working for me.

    • Jean Weatherwax

      Hi Ranjan, thanks for letting us know. If you long-press the link, do you see an option to open in App? Can you click that option if you see it? Sometimes Universal Links can be disabled, and this is the workaround to re-enable them. If this doesn’t appear as an option here, can you check out the troubleshooting steps here: https://dev.branch.io/getting-started/universal-app-links/support/ios/#troubleshooting-universal-links Also feel free to send an email to support@branch.io with the link you are testing, your App ID from your Dashboard, and what Phone/OS you’re testing for further help. Cheers!

      • Ranjan Sahu

        Hi Jean, thanks for your replay . Its working in iOS 9.3 device with live app but not working in iOS 8 device live and test app. In iOS 8 device when i long press the link i didn’t see the “Open in App” option. I already followed this link “https://dev.branch.io/getting-started/universal-app-links/support/ios/#troubleshooting-universal-links”.

        Thanks

        • Jean Weatherwax

          Hi, for older versions of iOS, you can support old URI paths: https://dev.branch.io/getting-started/universal-app-links/advanced/ios/#how-to-handle-old-uri-paths-with-universal-links. Make sure you install all previous versions of the app when testing as well. Another note – we only support Universal Links for the bnc.lt on live schemes, so please test with your live scheme. Don’t hesitate to contact support with further questions.

          • Ranjan Sahu

            Hi Jean, Finally its working for my live environment. But one issue is there , when i clicking a link from Skype message its redirect to iTunes only.

            Thanks.

          • Jean Weatherwax

            Hello, thanks for letting us know. Perhaps Skype does not have support for Universal links yet. Could you send your inquiries to support@branch.io for this and further questions so we can assist you a bit better? Cheers,

  • L wang

    Hi,Alex I’m facing a strange problem.All third party apps(Include System app like Mail/Notes),open my app when click some links in their web page that link to my domain(Because it cross domain[mydomain.com—>m.domain.com]).But when I click some links in my domain in Safari,it doesn’t open my app,but there is an open banner at top of the page.When I click that open button,it opens my app.
    Any ideas?

    • Alex Austin

      Hey L,

      The reason is that Apple has blocked *same domain* links from opening up the app in Safari. So if you click a mydomain.com link when mydomain.com is loaded, it won’t open the app. In order to trigger a Universal Link in Safari from your domain, it needs to be a different domain. One option is that you could use Branch’s generic domain or white label a Branch link and put it on your site to get the functionality from within Safari.

      I hope this helps!

      Alex

      • L wang

        As mentioned above,I did cross domain.For example,I opened mydomain.com in Safari,and click some link which is m.domain.com,and m.domain.com redirect to domain.com.So,this series of actions are domain.com -> m.domain.com -> domain.com,which means it does cross domain.What’s more,when I pasted mydomain.com in Wechat or ohter third party apps,clicking it opens mydomain.com in their in-app web page,and then i click some link which is m.domain.com,and it trigger Universal Link.But when in Safari,it’s not the same as the third party apps.

        • Alex Austin

          Can you try something other than a subdomain of your current domain?

          • L wang

            But don’t you think it’s strange?

          • Alex Austin

            Universal Links as a system were implemented in a strange way. I don’t have confirmation of the above but it’d be my first guess.

          • L wang

            Alex,Thanks for your reply.At last,I did it.
            As I describe above, I register domain.com in Xcode for Universal Link,and use m.domain.com to implement cross domain, this behaved very well but Safari.I tried many other methods,but make no sense.After nearly wasting a day,I changed my thoughts.I replaced domain.com with otherdomain.com in Xcode,and all the link in domain.com refer to otherdomain.com.When I test it, all apps turn to my app include Safari when I click some link in domain.com (which will refer to otherdomain.com) in their web page.What’s more,both domain.com and otherdomain.com supports HTTPS,but m.domain.com doesn’t.Wondering if it’s HTTPS that changed Safari’s behavior.

          • Alex Austin

            Oh! That could have been it. HTTPS is a requirement unless you package up the AASA file as I describe above.

          • L wang

            Hi,Alex.Came here again for another weird problem.Some users feedback that after they updated my app from App Store,they can’t open the app from Safari or other system apps, unless they reinstall it.Any ideals?

          • Alex Bauer

            Can you confirm your users have this problem ONLY with system apps, or is it simply that Universal Links in general are not working after the update? In other words, do you have an example where someone was able to open a Universal Link in a third-party app, but not able to do so in a Safari or another default app? If so, this would be very interesting!

            In our experience, iOS re-scrapes the apple-app-site-association file with each update downloaded from the App Store. If it encounters any sort of error during that process, it does NOT try again. This means if there was any sort of network disruption or temporary issue with your server, users may not have got the AASA file during the update and would need to reinstall the app. I actually ran into this exact situation with a Pinterest update earlier this week, so this could be the cause of what your users are seeing.

          • L wang

            Almost all of them can’t trigger this feature both system apps and third party apps.But one of them said he triggered this feature while he was in Wechat(a third party app) by chance,but after that time,he can’t trigger any more both system and third party apps.

          • Alex Bauer

            If you’re able to reproduce the WeChat-only Universal Linking behavior, that would be notable and worth some further investigation. Is this an ongoing issue with many/most users, or a temporary thing that seemed to have cleared up afterward?

          • L wang

            Maybe it should take some time for more details.I will update this once I can reproduce this issue.

  • Billy Lo

    great guide… thx for writing this up. minor fix for you as I follow the steps: to register, go to developer.apple.com. (instead of developers.apple.com in the doc.)

    • Alex Austin

      Thanks for the catch Billy – updated!

  • Ignacio Pascual

    Hi,

    I know right now Universal Links doesn’t work from feed view of Facebook native app but is something I need working in my app. So is there some way to make the deep link working from Fb app to my app in iOS +9.2?

    Thanks,
    Ignacio.

    • Alex Bauer

      Hi!

      There is currently no reliable way to deep link DIRECTLY out of the feed in the Facebook app. The workaround we use at Branch is our Deepviews feature, which opens up a web preview of your app content when the link is clicked. Once the webview is open, Universal Links work fine from within it. Take a look here for more info: https://dev.branch.io/features/deepviews/overview/

      • Ignacio Pascual

        Hey,

        Ok, so I guess I will go with Deepviews.
        Appreciate your help.

  • Bartłomiej Zdybowicz

    It does not work for me, I checked all steps few times and I all I get is landing on my www page (even when proper app is installed, iOS 9.3.3)

    • Alex Bauer

      Hi! Take a look through our Universal Links troubleshooting guide — it captures the most common configuration issues and solves many of problems that often come up: https://dev.branch.io/getting-started/universal-app-links/support/ios/#troubleshooting-universal-links

      • Bartłomiej Zdybowicz

        Links do not open from slack as well.

        • Alex

          Hey Bart – If you go through that guide and it doesn’t help, can you send a note to support@branch.io with your Branch key and a sample link so that the team could help you look for setup issues. Thanks to Apple, it’s an unfortunately treacherous configuration flow.

  • Sahil

    Hello ,

    It is possible to open a custom URL using ionicframework in iOS?

    I have tried numerous methods for the iOS but didn’t worked.However it worked for Android.

  • Fullgolden

    Hello,
    I did all your steps, I have a server but I don’t know where to put the JSON file and I don’t know where I can ‘configure’ it placing “application/pkcs7-mime’’.
    Thanks for your time 🙂

    • Alex Bauer

      Hi @fullgolden:disqus! This would depend very much on which server and environment you’re using. I’d recommend looking for further information in the documentation for your particular platform.

  • Tom Ryan

    “Little did we know how complicated it would be to get it working.”

    Every iOS experience ever.

    • Alex Bauer

      @disqus_hiuBSDadbY:disqus how very right you are. We all do what we can!

      If you have a chance to try out the Branch set up process, we’d always love to hear your thoughts on whether we successfully simplified things.

shares