In iOS 9 I can register my website (FooSite) to link to my app via Universal Link. Now let's say a user in another app (BarApp) encounters an HTTP link to my app (FooApp).
Does BarApp have the option to present FooSite instead of allowing iOS to resolve the universal link and launch FooApp?
Do the options change between UIWebView, WKWebView and Safari View Controller?
How do I set up Universal Links for my app? Log into your Apple developer account and go to the app's ID page. Enable the Associated Domains app service. Take note of your Prefix (bundle ID) and your ID (team ID) - you will need them later.
Universal Links are automatically turned on for all devices that use iOS 9 or above as the operating system. To return to your previous app, click the back arrow at the top of the page. We recommend using the latest available version of YouTube app because it has more features than the mobile web version.
Hosting the AASA File on Your Domain Once you are ready with your AASA file, you can now host it on your domain either at https://<<yourdomain>>/apple-app-site-association or at https://<<yourdomain>>/.well-known/apple-app-site-association. Upload the apple-app-site-association file to your HTTPS web server.
Universal Links for DevelopersSeamlessly link to content in your app or on your website. With universal links, you can always give users the most integrated mobile experience, even when your app isn't installed on their device.
To answer your first question, BarApp should not. I haven't tried to prevent this, but I can't see how, short of not firing the URI at all, BarApp could launch FooSite rather than FooApp.
To answer your second question, SFSafariViewController is extremely limited in what the developer is allowed to access. You can set an initial URL, know when the initial URL loads, and know when the user has tapped the dismiss button. That's it. No inspecting the current URL, no intervening in requests, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With