Search code examples
ios8uiapplicationopenurlios-app-extension

openURL from App Extension


On iOS 8 beta 2 it should be possible to use openUrl from app extension as written into the release notes:

enter image description here

however when I try to use this API (on Xcode 6 beta 2) I get the following error:

enter image description here

Beta 2 really fixed this issue or not?


Solution

  • you may use this code:

    [self.extensionContext openURL:url completionHandler:^(BOOL success) {
            NSLog(@"fun=%s after completion. success=%d", __func__, success);
        }];
    

    the API document: openURL:completionHandler:

    you could also refer to this question: openURL not work in Action Extension