Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - OpenURL from Keyboard extension on iOS 8.3 beta

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

like image 319
Pavlo Shadov Avatar asked Mar 18 '15 11:03

Pavlo Shadov


1 Answers

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

like image 163
merge Avatar answered Oct 14 '22 00:10

merge