takecian / SwiftRater

A utility that reminds your iPhone app's users to review the app written in pure Swift.
MIT License
356 stars 42 forks source link

Allow for an “any” strategy for ratings conditions as opposed to all having to be met #44

Closed AdeptusAstartes closed 1 year ago

AdeptusAstartes commented 2 years ago

Many users of ratings prompts like this one want to the prompt to happen when one or more of the conditions have been met as opposed to all of them, which is the current logic.

For example, with the below settings and the original logic, 5 days, 5 uses, and 10 significant uses would have to happen before the prompt is shown.

SwiftRater.daysUntilPrompt = 5
SwiftRater.usesUntilPrompt = 5
SwiftRater.significantUsesUntilPrompt = 10

Now, if you change the code as follows, only one of those conditions needs to be met:

SwiftRater.conditionsMetMode = .any
SwiftRater.daysUntilPrompt = 5
SwiftRater.usesUntilPrompt = 5
SwiftRater.significantUsesUntilPrompt = 10

So for example, if a user performs 10 significant actions before 5 days or 5 uses have passed, SwiftRater will now show the prompt. Please note that the default strategy is still .all so this new behavior is completely opt-in for users of this library.