Reputation: 604
We currently support wildcarding for Universal Links. So my applinks looks like: applinks:*.company.com
.
Let's say I want to only handle a link if it is https://company.com/?query1=abc
Let's say I instead tap on a link that is https://company.com/?query1=123
Since the condition is not met, I want to ignore this link and prevent my iOS App from responding to it. Is this possible?
I thought I'd just be able to return false
in continue:restorationHandler but that does not prevent the iOS App from opening.
Upvotes: 1
Views: 1038
Reputation: 114974
Returning false
from application(_:continue:restorationHandler:)
doesn't result in the URL being passed back to Safari (as you have discovered). The documentation states:
If you don't implement this method or if your implementation returns false, iOS tries to create a document for your app to open using a URL
So returning false just results in iOS trying to launch your app in a different way.
What you can do is call open(_:options:completionHandler:)
and pass the URL you received. The URL will then be opened in Safari; iOS won't pass your app a universal link that your app opens itself because that could create an infinite loop.
Upvotes: 2