使用带有查询参数 "action=write-review" 的 SKStore Review Controller 打开撰写评论页面

open write review page using SKStore​Review​Controller with query parameters "action=write-review"

https://developer.apple.com/documentation/storekit/skstorereviewcontroller/2851536-requestreview

Apple document suggest to automatically open a page on which users can write a review in the App Store, append the query parameter action=write-review to your product URL.

我想重定向用户在应用商店中写一个应用的评论页面。 我是新手 iOS 请指导我实现此功能。

谢谢。

这是我正在使用的

let appID = "Your App ID on App Store"
let urlStr = "itms-apps://itunes.apple.com/app/id\(appID)?action=write-review" 
if let url = URL(string: urlStr), UIApplication.shared.canOpenURL(url) {
    if #available(iOS 10.0, *) {
        UIApplication.shared.open(url, options: [:], completionHandler: nil)
    } else {
        UIApplication.shared.openURL(url)
    }
}