To run the example project, clone the repo, and run pod install
from the Example directory first.
Available on SDK iOS 10.3+
ReviewKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ReviewKit'
Define rules to show prompt:
// Request to rate or/and write a review on 3rd, 20th app launches & repeat for every 100th app launch
let appLaunchInterval = RequestInterval(first: 3, second: 20, repeatEvery: 100)
let rule1 = RequestReviewRule(ruleType: .appLaunches, requestInterval: appLaunchInterval)
// Request to rate or/and write a review on 5th and 15th time user finishes Say Hello process. Request again on every 50th time.
let sayHelloProcessInterval = RequestInterval(first: 5, second: 15, repeatEvery: 50)
let rule2 = RequestReviewRule(ruleType: .customProcess(key: "SAY_HELLO"), requestInterval: sayHelloProcessInterval)
// Request to rate or/and write a review on 5th and 10th time user finishes Wave Bye process. Request again on every 20th wave bye.
let waveByeProcessInterval = RequestInterval(first: 5, second: 10, repeatEvery: 20)
let rule3 = RequestReviewRule(ruleType: .customProcess(key: "WAVE_BYE"), requestInterval: waveByeProcessInterval)
Increment the occurrence of event/process:
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Registers and increments occurrence of app launch event
ReviewManager.default.incrementOccurrence(for: .appLaunches)
return true
}
Request for App rating/review
// Asks the user for ratings and review, if appropriate.
ReviewManager.default.requestReview(for: appLaunchRule)
ReviewKit is available under the MIT license. See the LICENSE file for more info.