0

When I want to open App2 in App1, I can do like this:

NSURL * myURL_APP_A = [NSURL URLWithString:@"openurl1://"];

if ([[UIApplication sharedApplication] canOpenURL:myURL_APP_A]) {

[[UIApplication sharedApplication] openURL:myURL_APP_A];

}

But when I want to open an App in a keyboard Extension, [UIApplication sharedApplication] cannot be used.So how can I make it?

Thanks for your help!

SamSam
  • 113
  • 8

2 Answers2

0

[UIApplication sharedApplication] openURL is currently not allowed in custom keyboards. You should see an error message popping up that tells you exactly that.

sdoowhsoj
  • 200
  • 1
  • 1
  • 9
0

You can try this method :

NSURL *url = [NSURL URLWithString:@"myapp://"]; 
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
[self.view addSubview:webView];
[webView loadRequest:urlRequest];
Liolik
  • 791
  • 6
  • 12