#import <StoreKit/StoreKit.h>
if (@available(iOS 14.0, *)) {
UIWindowScene *scene = self.view.window.windowScene;
[SKStoreReviewController requestReviewInScene:scene];
} else if (@available(iOS 10.3, *)){
[SKStoreReviewController requestReview];
}
import StoreKit
guard let scene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene else { return }
if #available(iOS 14.0, *) {
SKStoreReviewController.requestReview(in: scene)
} else {
SKStoreReviewController.requestReview()
}
跳转App Store 打开编辑评论页面
let str = "itms-apps://itunes.apple.com/app/id414478124?action=write-review"
UIApplication.shared.open(URL.init(string: str)!, options: [UIApplication.OpenExternalURLOptionsKey.universalLinksOnly:false], completionHandler: nil)