6

On my project I used a WebView to open a Container App from Keyboard extension. It worked ok until I tried to run it on iOS 8.3 beta.. On this new iOS version it just do nothing.

I tried to use NSExtensionContext and WKWebView - without any success too.

Does someone know how to openURL on keyboard extension on iOS8.3?

Thanks

Pavlo Shadov
  • 382
  • 4
  • 16

2 Answers2

5

Can you try this snippet?

-(void)openURL:(NSString*)url{
    UIResponder* responder = self;
    while ((responder = [responder nextResponder]) != nil) {
        NSLog(@"responder = %@", responder);
        if ([responder respondsToSelector:@selector(openURL:)] == YES) {
            [responder performSelector:@selector(openURL:)
                            withObject:[NSURL URLWithString:url]];
        }
    }
}

Cited from http://yusukekuni.hatenablog.com/entry/2015/05/01/144050

merge
  • 403
  • 5
  • 10
0

I have the same problem with a custom action.

As far as i know, using a webview to openUrl in an extension is a workaround and is not supported officially by the sdk. It seems that Apple removed it completely in iOS 8.3.

The only extension that supports openUrl for now is the widget.

yostane
  • 383
  • 1
  • 4
  • 19