Universal Links do not work via SFSafariViewController

Originator:aeromusek
Number:rdar://32840565 Date Originated:07/18/2017
Status:Open Resolved:No
Product:iOS Product Version:9-11
Classification:UX Issue Reproducible:Yes
 
Area:
Safari Services

Summary:
When any app uses SFSafariViewController to handle links, Universal Linking behavior is not triggered. Instead, the URL is opened as a website.

Steps to Reproduce:
1. Choose any app that implements SFSafariViewController.
2. Use that app to open a URL that is enabled for Universal Links.
3. Corresponding app will not launch. Instead, the link will always open as a web page regardless of whether the app is installed.

Expected Results:
When clicking a Universal Link inside an app that implements SFSafariViewController, the app corresponding to the link should open if it installed. This is the actual behavior if the app instead uses the main Safari app to handle links, so SFSafariViewController should act the same way.

Observed Results:
When clicking a Universal Link inside an app that implements SFSafariViewController, the web fallback location is always loaded.

Version:
All since iOS 9.0

Comments

Response to Apple

I look forward to hearing the conclusion! Universal Links are a major improvement in app UX — having them consistently work in every situation will be a significant win for users.

Response from Apple Developer Relations

We are taking another look and will follow up with you again.

Response from Apple Developer Relations

This issue behaves as intended based on the following:

Currently, having SVC auto-follow Universal Links isn’t possible.

We are now closing this bug report.

If you have questions about the resolution, or if this is still a critical issue for you, then please update your bug report with that information.

Please be sure to regularly check new Apple releases for any updates that might affect this issue.

Response to Apple

Could you clarify why this is intended behavior?

Universal Links are supposed to be a reliable, platform-wide mechanism for allowing the developer of the targeted app to control whether users are taken to the app or to their website. The intended behavior your describe removes that control, and places it in the hands of origin app that implements SFSafariViewController. This appears to fundamentally break the core value proposition of Universal Links.

It seems enabling the UIApplicationOpenURLOptionUniversalLinksOnly flag by default, and MAYBE allowing a specific opt out would be far superior for the overall health of the iOS ecosystem!

Response from Apple Developer Relations

This issue behaves as intended based on the following:

Opening a link in SFSafariViewController does not follow a Universal Link to an app. However, you can achieve what you’re looking for by using UIApplicationOpenURLOptionUniversalLinksOnly with -[UIApplication openURL:options:completionHandler:]. You can pass UIApplicationOpenURLOptionUniversalLinksOnly = true to force a Universal Link to open in an app or fail. If it fails, you can fall back to SFSafariViewController.

Please update your bug report to let us know if this is still an issue for you.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!