openURL from App Extension

Massimo Piazza picture Massimo Piazza · Jun 23, 2014 · Viewed 16.3k times · Source

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?

Answer

Laurence Fan picture Laurence Fan · Jun 23, 2014

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