If you are using SwiftUI, create AppDelegate class that inherits UIApplicationDelegate and
configure SwiftRater there. (Thanks @markgravity for the suggetion)
Shows review request if daysUntilPrompt days passed since first app launch.
usesUntilPrompt
Shows review request if users launch more than usesUntilPrompt times.
significantUsesUntilPrompt
Shows review request if user does significant actions more than significantUsesUntilPrompt
You can set properties you want to apply.
Property
Description
debugMode
Shows review request every time. Default false, need to set false when you submit app to AppStore.
conditionsMetMode
Possible values: .any, .all (default) Setting this to .any allows the prompt to be shown when any one or more of your criteria have been met.
showLaterButton
Show Later button in review request dialong, valid for iOS10.2 or before devices.
daysBeforeReminding
Days until reminder popup if the user chooses rate later, valid for iOS10.2 or before devices.
2.Call SwiftRater.check() in viewDidAppear of ViewController where you want to show review request dialog. If conditions are met, SwiftRater will show review request popup.
This example states that the rating request is only shown when the app has been launched 5 times and after 7 days, remind 5 days after if later selected.
SwiftRater
SwiftRater is a class that you can drop into any iPhone app that will help remind your users to review your app on the App Store/in your app.
SwiftRater is written in pure Swift.
iOS 10.3 〜
For iOS 10.3 devices, SwiftRater uses SKStoreReviewController.
〜 iOS 10.2
macOS 10.14 〜
For macOS 10.14 devices, SwiftRater uses SKStoreReviewController.
〜 macOS 10.14
Requirements
iOS 8.0, macOS 10.10 or later, written in Swift. Xcode 8.2 or later.
Installation
SPM
Open your project setting and navigate to “Package dependencies” tab. Put “https://github.com/takecian/SwiftRater".
Cocoapods
SwiftRater is available through CocoaPods. To install it, simply add the following line to your Podfile:
Carthage
SwiftRater is compatible with Carthage. Add it to your
Cartfile
:Usage
1.Setup SwiftRater in AppDelegate.swift. After setting up, call
SwiftRater.appLaunched()
.If you are using SwiftUI, create AppDelegate class that inherits UIApplicationDelegate and configure SwiftRater there. (Thanks @markgravity for the suggetion)
daysUntilPrompt
days passed since first app launch.usesUntilPrompt
times.significantUsesUntilPrompt
You can set properties you want to apply.
.any
,.all
(default)Setting this to
.any
allows the prompt to be shown when any one or more of your criteria have been met.rate later
, valid for iOS10.2 or before devices.2.Call
SwiftRater.check()
inviewDidAppear
of ViewController where you want to show review request dialog. If conditions are met, SwiftRater will show review request popup.3(Optional).For
significantUsesUntilPrompt
, you need to addSwiftRater.incrementSignificantUsageCount
in siginificant action for your app.4(Optional).Call
SwiftRater.rateApp(host:)
to let your users to review your app on the App Store/in your app directly.Example
This example states that the rating request is only shown when the app has been launched 5 times and after 7 days, remind 5 days after if later selected.
If you wanted to show the request after 5 days only and remind 7 days after if later selected, you can set the following:
If you wanted to show the rquest after a user performs 10 significant actions before 5 days or 5 uses have passed:
Customize text
You can customize text in review request dialog for iOS10.2 or before devices. Set text in following properties.
Country code
If your app is only avaiable for some coutnries, please add country code at Setup phase.
App ID
Optional, you can set App ID explicitly. If not, SwiftRater will get App ID from appstore by bundle ID.
Demo
You can find Demo app in this repo.
Author
takecian, takecian@gmail.com
License
SwiftRater is available under the MIT license. See the LICENSE file for more info.