1 | initial version |
There are several possible reasons why the SKOverlay may not launch the App Store when using UIKit in an App Clip. Here are some troubleshooting steps you can take to resolve the issue:
if #available(iOS 14.0, *) {
if let scene = UIApplication.shared.delegate?.window??.windowScene {
let _ = SKOverlay.supported()
let session = SKOverlaySceneSession(scene: scene)
}
}
if #available(iOS 14.0, *) {
if SKOverlay.isSupported() {
// SKOverlay is supported in user's region
} else {
// SKOverlay is not supported in user's region
}
}
if UIApplication.shared.canOpenURL(URL(string: "itms-apps://")!) {
// App Store is installed
} else {
// App Store is not installed
}
let productViewController = SKOverlay.appStoreProductViewController()
if productViewController == nil {
// User has restrictions on launching the App Store app
} else {
// User can launch the App Store app
}
class ViewController: UIViewController, SKOverlayDelegate {
...
func overlay(_ overlay: SKOverlay, didFinishDismissalWith response: SKOverlay.Response) {
// Debug errors here
...
}
...
}
By following these troubleshooting steps, you should be able to resolve any issues with SKOverlay in your App Clip.