UIApplication.open(url, options:[:], completionHandler) can call it's completion handler incorrectly

Originator:agiletortoise
Number:rdar://27027723 Date Originated:27-Jun-2016 08:24 AM
Status:Open Resolved:27-Jun-2016 08:24 AM
Product:iOS SDK Product Version:10b1
Classification:Serious Bug Reproducible:Always
 
Summary:
When calling UIApplication.open(url, options, completionHandler) on the URL of another application on the system, iOS can prompt the user to confirm allowing the URL open with a dialog as shown in the attached screenshot.  This occurs the first time an app attempts to open another app via URL.  

The completionHandler of the open method is called before this dialog is presented, with didOpen==true.  If the user cancels this dialog the URL is not opened, however.  The completionHandler should be called after user confirmation, and passed “didOpen==false” if the user cancelled.

Steps to Reproduce:
1. Call UIApplication.shared().open(url, options:[:], completionHandler) on a URL pointing to another app’s custom URL installed on the system.
2. If the app URL scheme is available on the device, the completionHandler is called immediately with didOpen == true.
3. “AppA wants to open AppB” dialog is presented, tap cancel.
4.  The URL is not opened.

Expected Results:
When user confirmation is required, the completionHandler should not be called until after the user has successfully confirmed or cancelled opening of the URL and the didOpen parameter passed to the completionHandler should reflect correctly whether the URL was, in fact, opened.

Actual Results:
completionHandler is called with didOpen == true, regardless of whether the user cancelled the operation or not.

Regression:
//none.

Notes:
//none.

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!