2

After calling SKStoreReviewController.requestReview(), the use will be presented a popup.

When the user taps on any of the options, how do I know the popup was dismissed?

Rodrigo Ruiz
  • 4,248
  • 6
  • 43
  • 75

1 Answers1

2

It's not possible to find out anything about the SKStoreReviewController directly.

The following post explains more about how the view is presented & may help you understand why.

However, I don't like that answer so I tested a variation of your comment and was able to determine exactly when the screen was dismissed.

The following is a very bare bones app that illustrates this:

import UIKit
import StoreKit

class ViewController: UIViewController {
    @IBOutlet weak var testView: TestView!

    override func viewDidLoad() {
        super.viewDidLoad()

        testView.isUserInteractionEnabled = false
    }

    @IBAction func submit(_ sender: UIButton) {
        testView.isUserInteractionEnabled = true
        SKStoreReviewController.requestReview()
    }
}

class TestView: UIView {
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        super.touchesBegan(touches, with: event)

        print("touch")
    }
}

What is going on here is that I have a view over my main screen that can only be interacted with after the prompt is displayed. You should of course clean it up such that it stops receiving input after the first success, but this does notify me of user interaction with the app after the request is dismissed.

CodeBender
  • 35,668
  • 12
  • 125
  • 132
  • How would I go about adding a blur image in the background for that controller then? – Rodrigo Ruiz Oct 17 '17 at 15:39
  • @RodrigoRuiz Assuming you know when it will be presented in advance, you can blur the screen before presenting. Once that is done, you could look for user interaction with the screen to remove the blur. That would be one way to infer that the screen has been dismissed. – CodeBender Oct 17 '17 at 16:06
  • @RodrigoRuiz Updated my answer to something that should cover your issue now. – CodeBender Oct 17 '17 at 16:21
  • I though of that, the problem is that it will only happen after the user interacts one more time after closing the popup, which means I can't remove my blur (for example) right after the store popup closes and before he even touches the screen again. – Rodrigo Ruiz Oct 17 '17 at 19:16