我想把一个“率/审查这个应用程序”功能到我的应用程序。

是否存在一种方法能够直接链接到应用商店中他们评论应用的屏幕?所以用户不需要点击主应用程序链接。谢谢。

编辑:由于缺乏回应,开始赏金。为了确保这一点非常清楚:我知道我可以链接到应用商店中我的应用页面,并让用户从那里点击到“审查这款应用”屏幕。问题是是否有可能直接链接到“审查这个应用程序”屏幕,这样他们就不需要点击任何东西。


当前回答

通过SKStoreProductViewController链接到AppStore中的任何应用程序

很容易通过SKStoreProductViewController链接到应用商店的应用程序。但是我有点纠结,所以我决定在这里展示整个过程和一些必要的代码。这种技术还可以确保始终使用正确的商店(对于本地化应用程序很重要)。

要在你的应用程序商店中显示任何应用程序的产品屏幕,你的任何应用程序ViewControllers遵循以下步骤:

在项目设置中添加StoreKit.framework(目标,构建阶段->链接二进制库 导入StoreKit到ViewController类中 使你的ViewController符合这个协议 SKStoreProductViewControllerDelegate 创建方法,将StoreView显示为所需的产品屏幕 解散StoreView

但最重要的是:出于某种原因,这在模拟器中不起作用——你必须在具有互联网连接的真实设备上构建和安装。

添加StorKit.framework到你的项目:

SWIFT 4:这是根据前面描述的步骤编写的代码:

    // ----------------------------------------------------------------------------------------
// 2. Import StoreKit into the ViewController class
// ----------------------------------------------------------------------------------------
import StoreKit

// ...

// within your ViewController

    // ----------------------------------------------------------------------------------------
    // 4. Create the method to present the StoreView with the product screen you want
    // ----------------------------------------------------------------------------------------
    func showStore() {
        
        // Define parameter for product (here with ID-Number)
        let parameter : Dictionary<String, Any> = [SKStoreProductParameterITunesItemIdentifier : NSNumber(value: 742562928)]
        
        // Create a SKStoreProduktViewController instance
        let storeViewController : SKStoreProductViewController = SKStoreProductViewController()
        
        // set Delegate
        storeViewController.delegate = self
        
        // load product
        storeViewController.loadProduct(withParameters: parameter) { (success, error) in
        
            if success == true {
                // show storeController
                self.present(storeViewController, animated: true, completion: nil)
            } else {
                print("NO SUCCESS LOADING PRODUCT SCREEN")
                print("Error ? : \(error?.localizedDescription)")
            }
        }
    }
    
// ...

// ----------------------------------------------------------------------------------------
// 3. Make your ViewController conforming the protocol SKStoreProductViewControllerDelegate
// ----------------------------------------------------------------------------------------
extension ViewController : SKStoreProductViewControllerDelegate {
    
    // ----------------------------------------------------------------------------------------
    // 5. Dismiss the StoreView
    // ----------------------------------------------------------------------------------------
    func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) {
        print("RECEIVED a FINISH-Message from SKStoreProduktViewController")
        viewController.dismiss(animated: true, completion: nil)
    }
}

其他回答

这在iOS 9 - 11上运行良好。

还没有测试早期版本。

[NSURL URLWithString:@"https://itunes.apple.com/app/idXXXXXXXXXX?action=write-review"];

从iOS 10.3开始,你可以将action=write-review查询项附加到https://itunes.apple.com/…和https://appsto.re/..。url。在iOS 10.3及以上版本,它会自动打开Write a review,而在较低的iOS版本中,它会回到应用程序的app Store页面。

iOS 11更新: 使用苹果的链接生成器:linkmaker.itunes.apple.com 而追加&action=write-review,似乎是最安全的方法。

对于低于iOS 7的版本,请使用旧版本:

itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=YOUR_APP_ID

这在我的端工作(Xcode 5 - iOS 7 -设备!):

itms-apps://itunes.apple.com/app/idYOUR_APP_ID

对于iOS 8或更高版本:

itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=YOUR_APP_ID&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software

代码片段(你可以复制粘贴它):

#define YOUR_APP_STORE_ID 545174222 //Change this one to your ID

static NSString *const iOS7AppStoreURLFormat = @"itms-apps://itunes.apple.com/app/id%d";
static NSString *const iOSAppStoreURLFormat = @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d";

[NSURL URLWithString:[NSString stringWithFormat:([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f)? iOS7AppStoreURLFormat: iOSAppStoreURLFormat, YOUR_APP_STORE_ID]]; // Would contain the right link

知道你的苹果应用程序id,它是你的itunes应用程序url后id字段的数字。

比如:https://itunes.apple.com/app/id148688859, 148688859是你的应用id。

然后,使用正确的应用程序id重定向到此url: https://itunes.apple.com/app/idYOUR_APP_ID?action=write-review。

如果你的应用已经通过了Beta测试,但还没有上线,那么应用评论链接是可用的,但它不会上线,不能留下评论。

登录iTunes Connect 点击我的应用 点击感兴趣的应用图标 确保你在App Store页面上 进入应用程序信息部分(它会自动带你到那里) 在页面底部有一个蓝色链接,上面写着在App Store上查看。点击它,它将打开一个空白页。复制页面顶部url栏中的内容,这就是你的应用评论链接。一旦应用程序上线,它就会上线。