Don't display UIAlertController when opening your own app's CFBundleURLTypes

Originator:greg
Number:rdar://22001495 Date Originated:26-Jul-2015 09:23 AM
Status:Open Resolved:
Product:iOS SDK Product Version:Xcode-beta (7A165t)
Classification:UI/Usability Reproducible:Always
 
Summary:
Starting in iOS 9b4, a UIAlertController is presented when an app tries to open another app with openURL:. This is confusing and disrupting to users when an app is trying to open URLs to itself, which must be done to authenticate in the OAuth authentication scheme. These URLs are in CFBundleURLTypes in Info.plist and should bypass this alert.

Steps to Reproduce:
1. Register myapp as a URL scheme in Info.plist CFBundleURLTypes
2. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"myapp://"]];

Expected Results:
AppDelegate's URL handling method is run.

Actual Results:
UIAlertController from system is displayed saying "MyApp wants to open MyApp."

Regression:
Regression since iOS 9b3.

Notes:
This can be seen when performing OAuth steps. If OAuth was performed in a UIWebView before, the alert displayed might say "MyApp wants to open MyApp." Now, with SFSafariViewController, it's "SafariViewService wants to open MyApp."

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!