0

I am trying to open the keyboard app on iOS using the following method:

- (void)actionForGotoHostAppWithURL:(NSURL *)url {
 UIResponder *responder = self;
 do {
 if ([responder respondsToSelector:@selector(openURL:options:completionHandler:)] && [responder isKindOfClass:[UIApplication class]]) {
 [responder performSelector:@selector(openURL:options:completionHandler:) withObject:url withObject:nil];
 break;
 }
 } while ((responder = [responder nextResponder]) != nil);
} 

While this works with older iOS versions, I am getting the following error with iOS 26:

Error Domain=NSOSStatusErrorDomain Code=-54 "(null)" UserInfo={_LSFile=LSOpenOperation.mm, _LSLine=835, _LSFunction=_LSIsRequestAllowed}

What is the new method for doing that?

HangarRash
16.8k5 gold badges31 silver badges64 bronze badges
asked Dec 19, 2025 at 7:39
6
  • 1. What URL are you using? 2. performSelection:withObject:withObject: only works with methods that take 2 arguments. You are trying to use it with a selector that takes 3 arguments. Call the method directly: [(UIApplication *)responder openURL:url options:0 completionHandler:nil];. Commented Dec 20, 2025 at 17:00
  • @HangarRash You cannot call openURL:options:completionHandler: directly on the application from an extension. That is evidently the restriction that the OP is trying to slide around. Commented Dec 20, 2025 at 19:56
  • @matt There was no mention of the posted code being in an extension. If that's the case and calling openURL... directly isn't allowed, then using performSelector to call it shouldn't work either, right? Commented Dec 20, 2025 at 22:23
  • Actually openURL works if you locate the application as a responder by walking the responder chain. You see, I've been doing this stuff a long time, so I recognize the pattern in the OP code. See stackoverflow.com/questions/27506413/… if you're curious. That the question itself is very confusingly written, is obvious. Commented Dec 20, 2025 at 23:03
  • Yes, that's right. I am indeed using that method in a keyboard extension. Before iOS26 this approach was feasible — even if the user hadn't enabled Full Access, you could perform the jump that way. But the latest system seems to have tightened Full Access on keyboards, so calling it that way no longer works. I'm looking for other alternative solutions, because some apps have already implemented this kind of jump, so there should be some workable solution. Commented Dec 21, 2025 at 3:54

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.