My share extension accepts a shared location and I want to bring the user into the containing app at the corresponding map screen.
I understandNSExtensionContext.open(_:completionHandler:) is restricted to Today widgets per the App Extension Programming Guide, and I observe it reporting success == false.
The technique I am asking about is different: walking the extension's responder chain to obtain the UIApplication instance, then calling open(_:options:completionHandler:) on it. In a minimal sample this launches the containing app and the completion handler reports success == true, on both iOS 26 and iOS 27.
What makes this worth asking rather than assuming:
It never references UIApplication.shared, which is annotated NS_EXTENSION_UNAVAILABLE_IOS.
open(_:options:completionHandler:) itself carries no extension-unavailable annotation in the SDK, so the call compiles cleanly even with APPLICATION_EXTENSION_API_ONLY = YES.
I am aware of https://developer.apple.com/forums/thread/773342, where an Apple Frameworks Engineer wrote that "There's no supported way for you to launch your app directly from App Extensions, except Today and Widgets." That thread does not cover the responder chain specifically, which is why I am asking.
My questions:
a) Is this permitted? Is obtaining UIApplication via the responder chain from a Share Extension and calling open(_:options:completionHandler:) considered a violation of App Store Review Guideline 2.5.1 (public APIs used as intended), independent of whether it currently functions?
b) If it is not permitted, what is the recommended way for a Share Extension to hand a location to its containing app such that the user arrives at the relevant screen?
The code in question, in its entirety:
@objc private func openUsingResponderChain() {
var responder: UIResponder? = self
while let currentResponder = responder {
if let application = currentResponder as? UIApplication {
application.open(targetURL, options: [:]) { [weak self] success in
self?.report("UIApplication via responder chain -> success = \(success)")
}
return
}
responder = currentResponder.next
}
report("No UIApplication found in the responder chain")
}
Full sample project: https://github.com/valtermak-voya/share-extension-open-url-repro
A containing app registering opensample:// plus a share extension target built with APPLICATION_EXTENSION_API_ONLY = YES. The method above is the whole of the extension's logic. Filed with DTS as Case-ID 22452440.