iOS App应用内评价

译自官方API文档:https://developer.apple.com/documentation/storekit/skstorereviewcontroller/2851536-requestreview?language=objc

转载请标注。


在iOS10.3之后官方API提供了应用内就能让用户给App评分的功能。具体实现是:

1.

#import

2.   由于10.3之后才支持,所以需要判断方法是否有效。具体实现应用内弹框评分就一句代码。

 if([SKStoreReviewController respondsToSelector:@selector(requestReview)]){

    [SKStoreReviewController requestReview];

}

以下是官方关于+ requestReview方法的具体说明:

Although you should call this method when it makes sense in the user experience flow of your app, the actual display of a rating/review request view is governed by App Store policy. Because this method may or may not present an alert, it's not appropriate to call it in response to a button tap or other user action.

就算现在你可以使用这个方法来让用户给你的App评分,但是具体评分反馈视图是否会显示还是要看AppStore的相关政策。由于使用这个方法没办法保证都可以弹出评分的alert,所以这并不适合作为一个按钮或者其他用户事件的响应。

Note

When you call this method while your app is still in development mode, a rating/review request view is always displayed so that you can test the user interface and experience. However, this method has no effect when you call it in an app that you distribute using TestFlight.

在开发模式下油调用这个方法,评分反馈视图都会显示,目的是为了方便开发者测试用户交互和体验。但是,通过TestFlight安装的App中调用这个方法就没效果了。

When you call this method in your shipping app and a rating/review request view is displayed, the system handles the entire process for you. In addition, you can continue to include a persistent link in the settings or configuration screens of your app that deep-links to your App Store product page. To automatically open a page on which users can write a review in the App Store, append the query parameteraction=write-reviewto your product URL.

当你在正式版本的App调用这个方法并且评分反馈视图也出现了,系统就会帮你处理好整个过程。此外,你可以在App的设置或者配置面板中添加应用在AppStore中的详情界面链接。在URL后拼接上“=write-reviewto”参数,就可以自动打开界面供用户在AppStore中填写反馈信息。

你可能感兴趣的:(iOS App应用内评价)