Can't get iOS 9 Universal Links to work

I'm having a bear of a time getting universal links in iOS 9 to work. Here's what I've done:


  • Uploaded an apple-app-site-association file to my website (https://nmrs.co). It's in the new format as prescribed by the App Search Programming Guide. In particular, the file isn't signed.
  • Checked that the site validates with Apple validator tool. Under the Universal Links section it says "Passed".
  • Added an entry to my app's entitlements file:


<key>com.apple.developer.associated-domains</key>

<array>

<string>applinks:nmrs.co</string>

</array>



Doing so always opens Safari, not my app. What am I missing?

So far it sounds good. One thing that I did notice is that your apple-app-site-association file is being served with a Content-Type of text/plain. It should be getting served with a type of application/json. Can you change that and see if deleting/installing your app works then? It would also be good to know if you're able to see your device fetching the apple-app-site-association file from your server. Can you determine if it is?

Thanks for your help. I just now changed the type of the file to application/json:


$ curl -I "https://nmrs.co/apple-app-site-association"

HTTP/1.1 200 OK

Date: Mon, 28 Sep 2015 18:16:54 GMT

Server: Apache/2.2.31 (Amazon)

Last-Modified: Sat, 19 Sep 2015 17:30:12 GMT

ETag: "107-d0-5201d0027d4df"

Accept-Ranges: bytes

Content-Length: 208

Content-Type: application/json


I then uninstalled/reinstalled the app and did see access in the apache log:


73.222.36.60 - - [28/Sep/2015:18:10:46 +0000] "GET /apple-app-site-association HTTP/1.1" 200 208 "-" "swcd (unknown version) CFNetwork/758.0.2 Darwin/15.0.0"


Unfortunately, tapping a link such as https://nmrs.co/m/mquyskqnd52o still goes right to Safari, not my app.


I should have also mentioned that I do have continueUserActivity: implemented but it never gets hit.


Any other ideas?

OK, that sounds good so far. The only other thing that I can think to double check right now is that your app's bundle ID is "com.numerousapp.Numerous", and that your team ID is correct as 4K6MZVJM9Q. I'm checkin on a couple other things as well.

I doublechecked both the bundle ID and the team ID and they are indeed both correct. Could it be because the apple-app-site-association file isn't signed? It seems like others that are actually working are signed, but I thought they didn't need to be any longer and frankly could never figure out how to do it properly. Thanks!

Can you confirm that signing of the apple-app-site-association file is necessary? I am in the exact same situation as mentioned above. When the app is installed I see in the server logs that the apple-app-site-association file is retrieved, but when I surf to my site in mobile safari it does not open my application.

Accepted Answer

Eventually I discovered that Universal Links were only failing on my iPhone. When I happened to try a TestFlighted version on my wife's phone, links to our domain went directly to the app and didn't open Safari.


The problem turned out to be that iOS had somehow decided that I the user just didn't want links opening the app and that I'd prefer them to go to Safari instead. It's totally unintuitive, but once in Safari if I tapped "Cancel" to the "Open in Numerous?" alert and then pulled down, a banner was revealed that allowed me to reverse this preference. Once I did that, our links started taking me directly to our app.


And fwiw our apple-app-site-association file is not signed.

hi, can you help me look , why my is not ok


i just upload the file , see https://m.alibaba.com/apple-app-site-association


But when i validate in the website https://search.developer.apple.com/appsearch-validation-tool/


this't not right

appSiteAssociationFile Not found

That URL doesn't load in my browser, so there's definitely something wrong. Did you make the file readable by the public?

I can't for the life of me get these universal links working. Always goes to safari regardless. I look at device logs and don't see anything when I launch app for first time after install about.


We have a SSL cert on our server, I have verified everything 3-4 times, regenerated prov profiles, team ID and bundle are correct. Apple validator says everything is good with our AASA file. Associated domains is on, and applinks is set.


I even used the validation app here http://limitless-sierra-4673.herokuapp.com/ against our IPA and AASA file, shows everything is good with all. Yet when I run the app then try to hit a link out of the notes app or messages app, goes straight to safari. Tried this on another device installing the app via Testflight, same result.


Any ideas what I could possibly be missing here?

This is virtually impossible to debug since there is no real output from the device in the logs in regards to this or maybe something I am not looking for?

Can't get iOS 9 Universal Links to work
 
 
Q