如何添加“撰写评论” /“给我们打分”功能到我的应用程序? [英] How to Add "Write a Review" / "Rate Us" Feature to My App?

查看:128
本文介绍了如何添加“撰写评论” /“给我们打分”功能到我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在我的应用中添加某种撰写评论或评价我们功能,以便我的客户可以轻松评分和查看我的应用。



我能想到的最佳做法是在我的应用程序中进行某种弹出或打开UIWebView,这样用户在打开App Store应用程序时就不会被我的应用程序踢掉,如下所示:



[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@itms://itunes.com/apps/myAppName]];



有没有人知道这样做的方法?

解决方案

StoreKit API(iOS 10.3及更高版本) )



从iOS 10.3开始,StoreKit API提供了一种在不离开应用程序的情况下在App Store上请求审阅的方法。当被呼叫时,系统可以向用户呈现请求评论的警报。用户可以直接在警报内提供星级评级,继续撰写评论或关闭警报。 StoreKit为您处理几乎所有事情。要提出审核请求,请在您的应用中进行以下调用:

  // Objective-C 
[SKStoreReviewController requestReview]

// Swift
SKStoreReviewController.requestReview()

根据Apple的说明,您不应该响应直接的用户交互(即点击写一个评论按钮)来调用它们,因为它可能并不总是显示警报。实际上,警报只能每365天显示三次。



以下是警报的示例。有关详细信息,请参阅






iRate( iOS 7.0及更高版本)



如果您的应用程序在早于10​​.3 的iOS版本上运行,则需要对用户请求评级进行更强大的控制, iRate是一个很好的解决方案。



对于iOS 10.3或更高版本的设备,iRate使用前面提到的StoreKit API。对于运行iOS 7.0到10.2的设备,iRate使用 uialertview storekit 以询问用户评分(或者稍后提醒他们)。一切都是可自定义的,从取消按钮的标题到提醒用户的间隔。



默认情况下,iRate会在满足某些要求时自动打开(例如app推出X次,用户传递了X个级别),但您也可以使用各种方法和自己的逻辑(借助iRate方法)手动显示iRate弹出窗口。



设置



要安装,只需拖动头文件,实现文件和 .bundle (用于本地化)到您的项目中。


  1. 在AppDelegate中导入标题: #importiRate .h

  2. StoreKit 框架添加到您的项目中 - 有关来自Apple文档的StoreKit

  3. 在你的 application:didFinishLaunchingWithOptio ns:方法,设置如下:

      //配置iRate 
    [iRate sharedInstance ] .daysUntilPrompt = 5;
    [iRate sharedInstance] .usesUntilPrompt = 15;




属性



以下属性可用于测试目的。在测试期间将其设置为 YES 以确保对话框正确显示。设置为 YES 时,它将在启动时立即显示,忽略其他显示设置。对于您的应用的发布版本,将此设置为

  [iRate sharedInstance] .previewMode = NO; 

appStoreID 属性允许您设置您的应用的ID。只有当您的Mac和iOS应用程序具有相同的Bundle Identifier 时才需要。此处设置的App ID还必须与Xcode和iTunes Connect中设置的Bundle ID相匹配:

  [iRate sharedInstance] .appStoreID = 555555555 ; 

更多详细信息可在iRate GitHub页面上找到。


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?

解决方案

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:

// Objective-C
[SKStoreReviewController requestReview]

// Swift
SKStoreReviewController.requestReview()

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 and 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.

  1. Import the header in your AppDelegate: #import "iRate.h"
  2. Add the StoreKit Framework to your project - More on StoreKit from Apple Documentation
  3. In your application: didFinishLaunchingWithOptions: method, set the following:

    // Configure iRate
    [iRate sharedInstance].daysUntilPrompt = 5;
    [iRate sharedInstance].usesUntilPrompt = 15;
    

Properties

The property below is useful for testing purposes. Set it to YES during testing to make sure the dialog appears properly. When set to YES it will appear immediately on startup, disregarding other display settings. Set this to NO for release versions of your app.

 [iRate sharedInstance].previewMode = NO;

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:

[iRate sharedInstance].appStoreID = 555555555;

More Details are available on the iRate GitHub page.

这篇关于如何添加“撰写评论” /“给我们打分”功能到我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆