调用SKStoreReviewController.requestReview()
后,会出现一个弹出窗口。
当用户点击任何选项时,我如何知道弹出窗口已关闭?
最佳答案
无法直接找到有关 SKStoreReviewController
的任何信息。直接。
following post explains有关如何呈现 View 的更多信息,可能会帮助您理解原因。
但是,我不喜欢这个答案,因此我测试了您的评论的变体,并能够准确确定屏幕何时关闭。
以下是一个非常简单的应用程序,说明了这一点:
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")
}
}
这里发生的事情是我的主屏幕上有一个 View ,只能在显示提示后才能与之交互。您当然应该清理它,以便它在第一次成功后停止接收输入,但这确实会通知我在请求被驳回后与应用程序的用户交互。
关于ios - 了解 SKStoreReviewController 何时被解雇,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46793479/