Block current view with SKStoreReviewController

I’m having an issue with SKStoreReviewController in my view controller. When I present the rating dialog and select “Not now”, the current view stays blocked and doesn’t allow interaction.

I’m using the following code in my viewDidLoad:

if #available(iOS 14.0, *),
    let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
    SKStoreReviewController.requestReview(in: scene)
} else {
    SKStoreReviewController.requestReview()
}

Does anyone have any ideas on how to fix this issue?

The issue you are facing with SKStoreReviewController is a known bug on iOS 14. When selecting “Not now” in the rating dialog, it causes the current view to stay blocked and prevents user interaction.

Unfortunately, there is no direct fix for this issue. It is a bug in the iOS framework itself. You can try some workarounds to mitigate the problem:

  1. As a workaround, you can delay the execution of the requestReview method by a few seconds using the DispatchQueue.main.asyncAfter function. This might allow the user to interact with the view before the rating dialog appears.

    DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
        if #available(iOS 14.0, *),
            let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
            SKStoreReviewController.requestReview(in: scene)
        } else {
            SKStoreReviewController.requestReview()
        }
    }
    
  2. Another workaround is to present the rating dialog from a different view controller rather than viewDidLoad. You can create a separate method to handle the rating dialog and call it from a different point in your code where it won’t interfere with the user’s interaction.

Remember that these workarounds might not completely resolve the issue, as it is ultimately a bug in the iOS framework.