Has anyone gotten Universal Links to work in iOS 9 Beta 5?

We have tried both a signed and unsigned apple-app-site-association file (hosted on an HTTPS server, of course.) The file appears syntactically valid (we get an error message when it's not) but the app never gets opened when trying from Safari, Messenger, etc.


The file is simply:


{
  "applinks": {
  "apps": [],
     "details": {
        "<TEAM_ID>.com.myapp": { 
              "paths": [ "*" ] 
         }
      }
  }
}


Does anyone have a working example of Universal Links? If so, could you share your JSON file and how you triggered the link (was it from Safari? Messenger?) We can't seem to get anything to work.

Replies

No success here either (SEE UPDATE BELOW). We've updated two iOS apps, gotten Core Spotlight indexing working on the device, but what should be universal links (in Safari or messages) open in Safari and our app is not launched or called.


Two things that seem unclear:


1. What label should be used in the app's com.apple.developer.associated-domain entitlement (as set in Capabilities)? Autofill and the handoff doc use "webcredentials:", but mentions of this on the forum use "applinks:" like the server json file. That doc doesn't say.


2. If the device's on-install reading of the json file is successful, does it print anything in console? I've read that errors are logged to console, but I don't see anything that looks relevant.


UPDATE:

I had success with a fresh start with a new app and site. Now I just have to figure out why our real app and site don't work.


On my test site (which serves http and https from the same folder) I did NOT sign the JSON file ( apple-app-site-association). In my test app (created from scratch with Xcode 7 beta), I added the associated domain entitlements (like applinks:www.aiiee.com) to the app and put the application:continueUserActivity:restorationHandler: method in the app delegate.


@slutsker, your JSON file looks just like mine. The only difference is the path "*" is on a separate line, and the ] after it is on a separate line, more like the example, but I don't think that matters.


I triggered the universal link by adding it to a Contact, so I could just tap it in the Contacts app on the device for testing.


I also tried going to the home page of the site in Mobile Safari, which was interesting: if I go to the site via https (which just opens the page without leaving Safari), tapping any internal link on the page opens my app. But if I go to the site via http, links stay in Safari. In other apps, it doesn't matter if a URL is http or https, both work the same and open my app.


I'm doing the minimum required per the newer doc: https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW1


The above was with beta 5. I still haven't seen anything relevant in the device console, although I haven't looked very hard.


P.S. Unsurprisingly, the same app did not work in the iOS 9 simulator.

Thanks for your help.


We got it working today, and it was a rather tricky issue. Basically, we figured out that the root domain was not working (http://example.com) but paths like http://example.com/whatever work. This JSON file covered all paths and worked:


{ "applinks": {
     "apps": [], 
     "details": {
          "<app_id>.stuff":{
               "paths": [ "*", "/" ]
          }
     }
  } 
}

Were you able to make it work on Xcode 7 beta 6?

This was very helpful. I now have Universal Links working -- with a twist.


1) I created the apple-app-site-association file as instructed here. The JSON file has "applinks:" in it.

2) I signed the file as instructed here and placed it to be found on our home page. (Note: my cert is a *.domain.com cert...)

3) I added the Associated Domains Entitlement as instructed in the first link, using "applinks:***.com" and "applinks:www.***.com".


That's it. When in iOS 9 I visit a web page listed in my site-association file (either http: or https: www.xyz.com or xyz.com) it pops a small banner at the top of the page saying "Open in the NoteStream app" and a big OPEN button. If I hit that button, it calls application:continueUserActivity:restorationHandler: method. This is NOT the familiar smart banner -- it looks different.


I have to say that I thought it would automatically pop into the app... But it doesn't. In fact, this overrides my web pages auto-redirect feature implemented in javascript that DOES auto-load the app if installed. I guess Apple want to give the user the option to switch into the app.


Final note: this works just the same if the app is compiled on Xcode 6.x and runs on iOS 9. You DON'T need Xcode 7 to implement this feature.


Second note: Typically, Safari shows the banner described above. But sometimes I have had the app auto-launch from a Universal Link on the web page into the app. Not sure why; either Safari is trying to guess my preference somehow, or iOS 9 is buggy...


Third note: This doesn't work on the iOS 9 simulator.


Fourth note: I notice that the current deep link handler (application:openURL:sourceApplication:annotation:) is deprecated in iOS 9... So this is the new deep link...

Further follow-up on how this is working... If you send some universal links to Gmail, then currently gmail will open the web version in "its" browser. If you hit the button to "open in Safari" you then trigger the launch of the app (Safari doesn't get the URL at all).


My old javascript routine IS triggered in the Gmail browser, so in that case the user is prompted: "Gmail is attempting to open NoteStream".


So they've got a ways to go on this.

Breaking news... Apple seem to have dropped the requirement to sign the JSON file in the latest iteration of their doc. The validator was giving an error all of a sudden, which I fixed by switching the apple-app-site-association file to an unsigned version.

Do you have some link to support your comment about not need sign app-site file?

This was covered in Session 509: Seamless Linking to Your App around the 14:05 mark. You still need to sign if you want to support Handoff in iOS 8. But for iOS 9+, no signing is required.

I'm not sure if this is a feature or a bug, but there appears to be some kind of logic that detects linking from a domain to the same domain.


If I tap a link on Domain A that opens Domain B, and my app is registered for Domain B, the universal link always opens my app (unless the user has opted-out). If I have a link to Domain B *from* Domain B, it stays in Safari. I've tried both absolute and relative URLs in the B->B case, but none of them open in my app.

When Safari shows the banner, does it have an title above "Open in the ____ app" for you? I noticed that applications from the App Store have the title, but I can't get this to appear in development for my app.


Update: It looks like the title is coming from the iTunesMetadata.plist's itemName key. I'm guessing this is only present when the user downloads the app from the store.