如何添加“撰写评论” /“给我们评分”我的应用程序的功能?
我希望在我的应用程序中添加某种“撰写评论”或“给我们评分”功能,以便我的客户可以轻松地对我的应用程序进行评分和评论。
我能想到的最佳实践是在我的应用程序中进行某种弹出窗口或打开 UIWebView,这样用户在打开 App Store 应用程序时就不会被踢出我的应用程序,如下所示:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/myAppName"]];
有谁知道如何做到这一点?
I wish to add some sort of a "Write a Review" or "Rate Us" feature to my app so my customers can easily rate and review my app.
Best practice I can think of is to have some sort of pop-up or open a UIWebView within my app so the user is not kicked off of my app while opening the App Store application as done in:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/myAppName"]];
Does anyone knows of a way to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
StoreKit API(iOS 10.3 及更高版本)
从 iOS 10.3 开始,StoreKit API 提供了一种无需离开应用程序即可在 App Store 上请求审核的方法。当被调用时,系统可能会向用户显示请求审查的警报。用户可以直接在警报内提供星级,继续撰写评论,或关闭警报。 StoreKit 几乎可以为您处理所有事情。要提出评论请求,请在应用程序中适当的位置进行以下调用:
根据 Apple 的说明,您不应调用这些来响应直接用户交互(即点击显示“撰写评论”的按钮),因为它可能并不总是显示警报。事实上,该警报每 365 天只能显示 3 次。
下面是警报的示例。有关详细信息,请参阅 Apple 文档。
iRate(iOS 7.0 及更高版本)
如果您的应用在早于 10.3 的 iOS 版本上运行或者,您需要对请求用户评分进行更强大的控制, iRate 是一个很好的解决方案。
对于运行 iOS 10.3 或更高版本的设备,iRate 使用上述 StoreKit API。对于运行 iOS 7.0 到 10.2 的设备,iRate 使用 uialertview 和 storekit 询问用户评级(或稍后提醒他们)。从“取消”按钮的标题到提醒用户的时间间隔,一切都是可定制的。
默认情况下,iRate 在满足某些要求时自动打开(例如应用程序启动 X 次、用户通过 X 级),但您也可以使用各种方法和您自己的逻辑(借助 iRate 方法)来打开手动显示 iRate 弹出窗口。
安装
要安装,只需将头文件、实现文件和
.bundle
(用于本地化)拖到您的项目中。#import "iRate.h"
在您的
应用程序中: didFinishLaunchingWithOptions:
方法,设置以下内容:属性
下面的属性对于测试目的很有用。在测试期间将其设置为
YES
以确保对话框正确显示。当设置为YES
时,它将在启动时立即出现,忽略其他显示设置。对于应用的发布版本,将此设置为NO
。appStoreID
属性允许您设置应用程序的 ID。 仅当您的 Mac 和 iOS 应用程序具有相同的捆绑包标识符时才需要。此处设置的 App ID 还必须与 Xcode 和 iTunes Connect 中设置的 Bundle ID 相匹配:提供更多详细信息在 iRate GitHub 页面上。
StoreKit API (iOS 10.3 and up)
As of iOS 10.3, the StoreKit API provides a way to request a review on the App Store without leaving your app. When called, the system may present the user with an alert that requests a review. The user may provide a star rating directly inside the alert, continue on to write a review, or dismiss the alert. StoreKit handles just about everything for you. To present the review request, make the following call where it is appropriate in your app:
As per Apple's instructions, you should not call these in response to a direct user-interaction (i.e. tapping a button that says "Write a Review") because it may not always display the alert. Indeed, the alert may only be displayed three times every 365 days.
Below is an example of what the alert looks like. For more information, see Apple's documentation.
iRate (iOS 7.0 and up)
If your app runs on versions of iOS earlier than 10.3 or you need more robust control over requesting ratings from users, iRate is a good solution.
For devices with iOS 10.3 or greater, iRate uses the aforementioned StoreKit API. For devices running iOS 7.0 to 10.2, iRate uses a uialertview and storekit to ask the user for a rating (or to remind them later). Everything is customizable, from the title of the Cancel button to the interval at which it reminds the user.
By default, iRate automatically opens when certain requirements are met (e.g. app launched X number of times, user passed X number of levels), but you can also use a variety of methods and your own logic (with the help of iRate methods) to manually display an iRate popup.
Setup
To install, just drag the header file, the implementation file, and the
.bundle
(for localization) into your project.#import "iRate.h"
In your
application: didFinishLaunchingWithOptions:
method, set the following:Properties
The property below is useful for testing purposes. Set it to
YES
during testing to make sure the dialog appears properly. When set toYES
it will appear immediately on startup, disregarding other display settings. Set this toNO
for release versions of your app.The
appStoreID
property allows you to set the ID of your app. This is only required if you have both Mac and iOS apps with the same Bundle Identifier. The App ID set here must also match the Bundle ID set in Xcode and iTunes Connect:More Details are available on the iRate GitHub page.
我使用的一个非常好的 Appirater:https://github.com/arashpayan/appirater/
它自动提示您的用户留下评论,您只需提供您的应用 ID。
A really good one I use is Appirater: https://github.com/arashpayan/appirater/
It automatically prompts your users to leave reviews, you just have to provide your app id.
声明变量
let reviewService = ReviewService.shared
在视图中出现
self.reviewService.rateAlert(from: self)
导入类
Declare Variable
let reviewService = ReviewService.shared
In View Did Appear
self.reviewService.rateAlert(from: self)
Import the Class
您可以使用我的 SKStoreReviewController 小型包装器。
https://github.com/mezhevikin/AppReview
You can use my tiny wrapper around SKStoreReviewController.
https://github.com/mezhevikin/AppReview