NSExtensionContext -openURL:completionHandler: fails to open URLs in Action Extension

Originator:arkadiusz.holko
Number:rdar://17376354 Date Originated:19-Jun-2014 12:26 PM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 8 beta 2
Classification:Bug Reproducible:Always
 
Summary:
NSExtensionContext's -openURL:completionHandler: doesn't open URLs and passes success = NO in its completionHandler when it's called from the Action Extension; no matter what kind of URL is used. I tested it with:
- http:// URLs
- mailto: URLs
- custom URL scheme

This method would be really useful with custom URL schemes, for example we could redirect the user to preferences or help inside the app.

If it's an expected behavior, then the documentation should note that this method doesn't work with Action extensions.

Steps to Reproduce:
1. Create an iOS 8 app and add an Action Extension to it
2. in ActionViewController -viewDidLoad add:
        [self.extensionContext openURL:[NSURL URLWithString:@"http://maps.apple.com/?q=cupertino"] completionHandler:^(BOOL success) {
            NSLog(@"%d", success);
        }];
3. Attach debugger to the extension process

Expected Results:
Maps.app should be opened and `success` should equal YES

Actual Results:
Maps.app isn't opened, `success` equals NO

Version:
iOS 8 beta 2

Configuration:
iOS Simulator, iPad 3

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!