应用外部
let appID = ""
if let url = URL.init(string: "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=\(appID)&pageNumber=0&sortOrdering=2&mt=8") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
/// 打开应用详情
// "itms-apps://itunes.apple.com/app/id\(appID)"
应用内部
SKStoreReviewController.requestReview()
应用内部打开下载页面
let toVC = SKStoreProductViewController.init()
toVC.delegate = self
let kAppId = ""
let keyD = [SKStoreProductParameterITunesItemIdentifier:kAppId]
toVC.loadProduct(withParameters: keyD) { [weak self](falg, error) in
if error == nil {
self?.present(toVC, animated: true, completion: nil)
}
}
代理实现 SKStoreProductViewControllerDelegate
func productViewControllerDidFinish(_ viewController: SKStoreProductViewController){
self.dismiss(animated: true, completion: nil)
}
网友评论