Universal Links: Make the Connection | Ray Wenderlich

Learn how to connect your iOS app with your website using Universal Links, so users can tap a link and go directly to the corresponding content in your app!


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/6080-universal-links-make-the-connection

Hi.
I’ve finished this tutorial and I think that I’ve found two issues here:

  1. When application(_:continue:restorationHandler:) is called, our components.path value comes with a “/” before the rest of it, something like “/example.html”. So the filtering never finds a “computer” match.
    This is easy to fix by updating the project JSON file like this: “arduino.html” → “/arduino.html”.
  2. For some reason, the presentDetailViewController method is not working. It gets to the “pushViewController” line but does nothing.

Anyway, this sample app is handling those universal links and I’ve learned a lot with this tutorial. Thanks.

@owenb Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hi luisquin,

Thanks for the post.
I looked into the pushViewController issue you mentioned. Are you sure it is hitting this code or getting exited in the guard let above it?

It seems this is because the navigationVC object has just been instatiated and is not actually being presented.

Try this to get the navigation controller that is being presented in this case.

  guard 
    let detailVC = storyboard
      .instantiateViewController(withIdentifier: "DetailController")
        as? ComputerDetailController,
    let navigationVC = window?.rootViewController as? UINavigationController
  else { return }

@xpereta Thank you for sharing your solution - much appreciated! :]

I have a paid apple developer account but my app is not in the App Store can I test the universal link in my app locally in a simulator/test device, does it work ?

@owenb Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hi nishanthgolla,
Note : Universal links are, in many ways, a replacement for apps that register their own URL schemes. They work by providing a small file (served over HTTPS) from the root of a web domain that points to a specific app ID, and then registering that specific app ID with Apple as handling links from that domain.

Because of these requirements, you won’t be able to fully try out universal links without having a real web site accessible via HTTPS and a real app on the App Store, but you can still gain experience with universal links by going through the process of setting everything up.

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!