LoginSignup
68
52

More than 5 years have passed since last update.

<Swift> iOS 10.3からアプリ内レーティングが可能に!- SKStoreReviewController -

Last updated at Posted at 2017-01-25

TL;DR

タイトルのままです。これまではユーザーをAppStoreにリダイレクトさせ、レビューやレーティングをお願いする必要がありましたが、iOS 10.3からSKStoreReviewControllerを使うことで、下記のようなアラートでアプリ内レーティングが可能になりました。

Simulator Screen Shot Jan 26, 2017 8.05.57.png

SKStoreReviewControllerインターフェース

requestReview()メソッドしか現在のところはありません。

@available(iOS 10.3, *)
open class SKStoreReviewController : NSObject {


    /** Request StoreKit to ask the user for an app review. This may or may not show any UI.
     *
     *  Given this may not succussfully present an alert to the user, it is not appropriate for use
     *  from a button or any other user action. For presenting a write review form, a deep link is 
     *  available to the App Store by appending the query params "action=write-review" to a product URL.
     */
    open class func requestReview()
}

使い方

従って、使い方もすごくシンプルです。

// Xcode Version 8.3 beta (8W109m)
import StoreKit
SKStoreReviewController.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 Storeポリシーによって管理されます。
  • 必ずアラートが表示されるわけではないため、ボタンタップやその他のユーザーアクションをトリガーとするのは適切ではありません。

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ではこの動作はしません(= 本番と同じく表示は保証されない)

以上

参考

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

68
52
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
68
52