Tapping a universal link shouldn't bring app to the foreground without checking for support first

Originator:bill.dunay
Number:rdar://47351642 Date Originated:January 17 2019
Status:Open Resolved:
Product:UIKit Product Version:12.x
Classification:Enhancement Reproducible:yes
 
When a user taps on a universal link my app supports I noticed that iOS will first open my app, bring it to the foreground AND THEN call `application(_:willContinueActivityWithType:) -> Bool` and `application(_:continueUserActivity:restorationHandler:) -> Bool` methods. 

In a perfect world this is fine. But there are times where the apple-app-site-association (AASA) file and the app can get out of sync causing the app to open but no action taking place (reminds me of the stringly typed API's left over from Objective-C). We've seen these two cases in the field:

1. The application on the user's phone is out of date. The AASA file has new URLs in it that a newer version of the app supports but the old version(s) do not.
2. (Rare) The AASA file gets updated on the live site before a new version of the app has been deployed or approved to be on the App Store.

We've solved this problem by implementing a "redirect" UX that informs the user their app is out of date and redirects them back to Safari using the link they originally tapped on, but I feel like we could avoid this all together with a simple solution.

What if instead of bringing the app into the foreground it is instead pinged in the background via AppDelegate method asking the app if the URL provided is supported by the application and returns a BOOL? Perhaps calling `application(_:willContinueActivityWithType:) -> Bool` or a new method is introduced such as `application(_: canContinueWithURL:) -> Bool`.

If it FALSE false the user is kept in Safari and navigated to the link they tapped on. 

If it returns TRUE then the app is brought to the forground and `application(_:continueUserActivity:restorationHandler:) -> Bool` is called.

To me, this avoids a bad user experience with iOS and my application in opening an app that then does nothing in response to something they tapped on instead of just navigating to the correct URL in Safari.

I know we try to avoid this situations by being aggressive with keeping the app and operating system updated and keeping our backend servers correctly up to date but, I think a simple solution would lead to a better user experience for everyone. It may not get 100% of the cases, but quality apps would do the right thing.

Thank you for your consideration.

Comments


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!