TestsTested | โ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jul 2016 |
SPMSupports SPM | โ |
Maintained by Gasper Kolenc.
PushReview is a library aimed at getting your app the reviews it deserves
In order to start using PushReview, there are two calls you need to make:
PushReview.configureWithAppId(appId: "app_id", appDelegate: self)
in your delegateโs application:didFinishLaunchingWithOptions:
method with the app id provided by Apple.PushReview.registerNotificationSettings()
somewhere in your app. A good place to call it is right after asking the user for push notifications yourself.func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Your app's code...
PushReview.configureWithAppId("0123456789", appDelegate: self)
PushReview.registerNotificationSettings()
PushReview.usesBeforePresenting = 10
return true
}
There are two ways to prompt user for a review:
Preffered method is by knowing who your happy users are. When you have identified a user as a happy user, simply do the following based on whether you have this information on the client side or server side:
Client side: Simply call PushReview.scheduleReviewNotification()
and everything will be handled by PushReview. There will be a notification displayed a while after the user stops using the app.
Server side: Send a push notification with pushReview_Category
as its category. Example payload:
{
"aps": {
"alert": "Hey there! Would you be so cool as to give us a thumbs up on the App Store? ๐ป",
"sound": "default",
"category": "pushReview_Category"
}
}
If you have no way of knowing who your happy users are, you can always fall back to number of app starts. Because hey, if a user opens your app 20 times, she must be happy usesBeforePresenting
to a number that you particularly like, e.g. PushReview.usesBeforePresenting = 20
.
Even though PushReview is made as such that it just works out of the box, there are a number of ways to customize it to work just the way you want it to work.
bodyText
and several other variables.usesBeforePresenting
to something other than nil
.shouldShowWhenAppIsActive
to true
and it will display a neat little alert view when needed.timeBeforeReminding
) and also what should be the delay until the notification is presented after the app goes to the background (timeBeforePresentingWhenAppEntersBackground
).To see PushReview in action, there are of course several ways of playing around with it.
PushReview.scheduleReviewNotification(delay: 10)
and lock your device. You should see a neat little notification poping up after 10 seconds.PushReview.shouldShowWhenAppIsActive = true
and call PushReview.presentReviewAlert()
. This will bring up the old fashioned alert view that we all love to hate.PushReview.reviewApp()
. Simple.Recommend way to install PushReview is using CocoaPods.
Just put this in your Podfile
:
use_frameworks!
pod 'PushReview'
When using iOS 7, copy and paste the PushReview.swift
file in your Xcode project.
PushReview is released under the MIT license. See LICENSE for details.