CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2017 |
SwiftSwift Version | 3.1 |
SPMSupports SPM | ✗ |
Maintained by kchau.
A Polite Way to Request Reviews for iOS
Polite Review is an elegant way to request ratings and reviews from your users.
Automatically grabs your localized app name and uses "this app" as a default.
Localized, curently English, Chinese Simplied, and Chinese Traditional.
For 10.3 and above, uses StoreKit
to request reviews, in compliance with store guidelines.
For below 10.3, falls back to a simple alert which will open the App Store to the review page.
The best way to get started with PoliteReview is with Carthage(coming soon) and CocoaPods.
Add PoliteReview to AppDelegate
import PoliteReview
...
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
PoliteReview.main.setup(itunesID: <your itunes id>, contactURL: <a link to a website contact page>, contactEmail: <your contact email>, triggerCount: <a launch count>)
return true
}
In any ViewController, you can request a review by calling requestPoliteReview()
. PoliteReview will determine if an alert will be shown.
Example:
class ViewController: UIViewController {
...
func methodCalledByUser() {
...
requestPoliteReview()
}
}
PoliteReview supports Notifications. You can use these to trigger analytics events, or for other things. They will report with userInfo
for the result of the action, with yes as true
and no as false
Notification.Name
is extended, and you may observe the following.
.politeReviewLoveAlert
with userInfo
: PoliteReviewNotification.loveAlert
.politeReviewLegacyRequest
with userInfo
: PoliteReviewNotification.legacyReview
.politeReviewContactAction
with userInfo
: PoliteReviewNotification.contactAction
.politeReviewLegacyRequest
is only posted when a user is below 10.3
.
Usage:
// Register your observer
NotificationCenter.default.addObserver(self, selector: #selector(observedMethod(_:)), name: .politeReviewLoveAlert, object: nil)
// Method to handle your observer
@objc private func observedMethod(_ notification: Notification) {
if let action = notification.userInfo?[PoliteReviewNotification.loveAlert] as? Bool {
if action == true {
// Do stuff when user likes your app - they may have left a rating
} else {
// Do stuff when user did not like your app
}
}