Prior to iOS 14.5 or 14.6, we could launch the main app from a share extension by setting Require Only App-Extension-Safe API to NO and using:
if #available(iOS 10.0, *) {
UIApplication.shared.open(urlToOpen, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(urlToOpen)
}
But iOS 14.5 or 14.6 onwards, we get this error when building:
Application extensions and any libraries they link to must be built with the `APPLICATION_EXTENSION_API_ONLY` build setting set to YES.
Is there a way to launch the main app from share sheet extension in iOS 14.5/14.6?