After launching Touchgram v1.0, which is 99% iMessage app extension, I tried to update to XCode11.
I started getting an error open(_:options:completionHandler:) is unavailable in application extensions
I confirmed this occurs even in a trivial sample that tries to launch a web URL from an iMessage app:
For example:
let openSel = #selector(UIApplication.open(_:options:completionHandler:))
while (responder != nil){
if responder?.responds(to: openSel ) == true {
// cannot package up multiple args to openSel
// so we explicitly call it on the iMessage application instance
// found by iterating up the chain
(responder as? UIApplication)?.open(url, completionHandler:handler)
return
}
responder = responder!.next
}
Update 2020
My own answer to this question, below, details how the workaround works. Note that the sample linked above has been fixed to both use this workaround and also show opening a web URL inside a WKWebView
inside the iMessage extension itself.