Skip to content

Request reviews only from users with enough recent positive activity and only at appropriate times.

License

Notifications You must be signed in to change notification settings

joeljfischer/ReviewKit

 
 

Repository files navigation

ReviewKit Logo

ReviewKit

Request reviews only from users with enough recent positive activity and only at appropriate times.

Read the Introduction Article to learn how to best use ReviewKit in your app.

Requirements

  • Minimum deployment target iOS 11+, macOS 10.14+
  • Swift 5.8+ (Xcode 14.3+)

Usage

  1. Add ReviewKit to your app using SwiftPM:

    https://github.com/FlineDev/ReviewKit.git
    
  2. (Optional) Adjust the criteria by which app reviews are requested on app start (defaults to 3 positive events & expiration after 14 days):

    import ReviewKit
    // ...
    ReviewKit.criteria = ReviewCriteria(minPositiveEventsWeight: 5, eventsExpireAfterDays: 30, minimumTimeBeforeRequest: DateComponents(day: 1))
  3. Determine common workflows in your app and when a user completes one of them, call this:

    ReviewKit.recordPositiveEventAndRequestReviewIfCriteriaMet()
  4. (Optional) Determine other activities that you think are positive experiences for your users. If they are in the middle of workflows, instead of the above call:

    ReviewKit.recordPositiveEvent()  // optionally, you can pass a custom `weight` parameter, defaults to 1
  5. (Optional) Set a delay between crossing the threshold and showing the review request.

    ReviewKit.reviewDelay = 5.0

That's it – you have configured App Review requests for your app!

Notes

  • ReviewKit is using Apple's SKStoreReviewController API internally. That API already encapsulates some logic to make sure not to ask users too often.
  • That logic is turned off in DEBUG mode, so you might want to set ReviewKit.enabledInDebugBuilds = false once you've tested that everything works.
  • There's also a function requestReviewIfCriteriaMet() that does not record a positive event in case you need that.

Showcases

I extracted this library from and use it directly in the following apps (check them out to support me!):

License

This library is released under the MIT License. See LICENSE for details.

About

Request reviews only from users with enough recent positive activity and only at appropriate times.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%