1

I am trying to implement an associated domain for an app I'm working on. So far, I have:

  • Enabled the Associated Domains capability of the app
  • Added all required domains with applinks:www.domain.com
  • added an apple-app-site-association file to the root of my server, and when that didn't work also to the .wellknown on my server

This didn't work. When I go to the page that is supposed to open a view controller in my app, it doesn't redirect but only show the banner instead. When I tap the 'Open' button on the banner, however, the right view controller in my app is shown.

Then:

  • I tried changing the mime type of the file, from application/json to application/pkcs7-mime.
  • I verified there is no .json extension
  • I verified that my server returns a valid response code (200), doesn't redirect, provides the file over https (I havent encrypted it).
  • I verified the file has valid JSON.
  • I even checked in my browser whether it finds the file and it does.
  • Finally, I have copy-pasted the URL in notepad on the iPhone, long-pressed it and the option 'Open in App' appeared.

Nothing appears to be wrong, yet iOS doesn't link to the app in any circumstances, it only shows the Banner.

What am I missing here? How can I get safari to open my app instead of just showing the banner?

P.S. please note: The website of this project is an asp .net application

Joris416
  • 4,751
  • 5
  • 32
  • 59
  • You have to add deeplink and when user browse your link from iOS web browser then you have to redirect to your deeplink url i.e. from www.xyz.com to myApp:// and add url scheme to your info.plist – Shahrukh Apr 09 '19 at 12:24
  • @Shahrukh thank you for your quick response. I have done everything except adding something to my info.plist as this is not documented by apple. Can you explain this a bit further? – Joris416 Apr 09 '19 at 12:26
  • Yes as in our app we have achieved like that. When user click on our link then we detect browser and as per OS we redirect to specific app url schemes. so then using deeplink we open our app. we have faces same issue as you said banner appear and user has to click Open button. – Shahrukh Apr 09 '19 at 12:29
  • https://medium.com/wolox-driving-innovation/ios-deep-linking-url-scheme-vs-universal-links-50abd3802f97 may be this will help you. – Shahrukh Apr 09 '19 at 12:30
  • This article is explaining the same things I did. Adding URL Types to an app's info tab works for deep links, not for website associations. – Joris416 Apr 09 '19 at 12:37
  • Can you explain to me, specifically, how you achieved to Avoid the app banner and redirect the user to your app straight away? I cannot use deep links as they don't work if the app is not installed. I only want to open the app if it's actually on the phone. – Joris416 Apr 09 '19 at 12:38
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/191533/discussion-between-shahrukh-and-joris416). – Shahrukh Apr 09 '19 at 13:00
  • Hello @Joris416: It looks like you have done everything correct. But deep link works in this way. If you keep that link in email or in other app: it will directly open your app(without going through safari). But if you open the same URL in safari, it will show only banner, from there you can move to your app. – Mehul Thakkar Apr 09 '19 at 13:00
  • As @Shahrukh has suggested, you can also deep link via old way, i mean via `url schema`. But i think you are on correct path. Keep using this modern way. – Mehul Thakkar Apr 09 '19 at 13:02
  • One more thing to note, if your app is not getting opened from link pasted in 'note' or in 'email', then please uninstall your app, and then reinstall it again. As, if you have added app-association file on server after installing your app, then it will not work. – Mehul Thakkar Apr 09 '19 at 13:04
  • Yes, If your app is not installed then banner will show app store "GET - On The App Store" message. https://stackoverflow.com/a/50543403/5523205 – Shahrukh Apr 09 '19 at 13:11
  • I agree with @Mehul keep using this modern way. – Shahrukh Apr 09 '19 at 13:12

0 Answers0