8

I am trying to create Universal links for my app. I am using the apple validation tool to test my server configuration (https://search.developer.apple.com/appsearch-validation-tool/) and everything looks fine.

enter image description here

So I run my app which has the:

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler

method implemented but my app never opens. I can only see Safari. Entitlements are also added to XCode. The funny thing is that on the smart app banner I never get the word open but I get the view button so that I can download it form the app store. Am I doing something wrong or must my app be uploaded to the appstore so that the links can be opened by it?

alecnash
  • 1,750
  • 1
  • 18
  • 42
  • check whether you have implemented Universal Link correctly http://stackoverflow.com/questions/35609667/how-to-support-universal-links-in-ios-app-and-setup-server-for-it/35609668#35609668 – Vineet Choudhary Mar 05 '16 at 14:08

3 Answers3

1

For me the problem was that in the Appstore version I clicked once on the top right to get forwarded to the Safari page. This behaviour was saved even through uninstall and new installations of the app. In the dev version I never clicked on the top right corner and therefore universal linking worked all the time.

How to fix it: For example go to notes and create a link https://example.com/whatever now long press on this link and select Open in "<App Name>"

hashier
  • 4,670
  • 1
  • 28
  • 41
0
  • let's start with: your app does NOT have to be uploaded to the app store for this to work.

  • is your development hitting the exact same web server? no dev / qual.mydomain.com?

  • verify that the Team ID / bundle identifier combination are correct in your JSON file

  • send the link to yourself via messages app or mail and you long press it. do you get the "open in 'YOUR APPLICATION'"? That would mean it is basically working, you 'just' have a problem with Safari (There are reports of the Universal Links not opening from the same domain in Safari). also apparently iOS can be in a kind of 'mode' to not open the app anymore until you explicitly ask Safari to do that again (see this answer)

  • do you see any lines in the device log from swcd, those could give details about any errors with the JSON file download

  • after running the app from Xcode for the first time on a clean device, you should also see the hit on your web server downloading the apple-app-site-association file

UPDATE:

  • if you're using the root of your registered domain as the universal link make sure to checkout this answer on stack overflow. Apparently for this to work, they had to include both paths: "*" as well as "/".
Community
  • 1
  • 1
wrtsprt
  • 5,319
  • 4
  • 21
  • 30
  • 1. I was not sure cause in the safari I dont get the "open" button but the "view" in app store button. 2. It's exactly the same server. 3. I've tried that. Nothing happens! 4. No errors. 5. I have to go through the whole log files and have not done that yet :p – alecnash Nov 25 '15 at 16:12
  • 5. Probably best to remove the app from the device, get a current `tail -f` and hit `Run` in Xcode to be sure. – wrtsprt Nov 26 '15 at 08:44
  • just logged it and its hitting the server. Also have in the association file the thing you mentioned in your update. Still cannot make it to work! – alecnash Nov 27 '15 at 17:02
  • @alecnash so the app hits the server and tries to download the JSON file, that is valid according to the search validation tool. and you're sure there is no `swcd` error in the logs? Could you paste the JSON file, so we can check the content / structure. (`.`?) – wrtsprt Nov 28 '15 at 15:57
0

My problem was that Entitlements.plist was not included when I did a Dev build, only when I built for Ad-Hoc. (I'm using Xamarin)

Johan Franzén
  • 2,355
  • 1
  • 17
  • 15