A rating gateway which takes care of when to prompt the user to review your Xamarin application by evaluating through a set of defined conditions each time a rating action is triggered by the user.
Catching the perfect moment to prompt your user to review your application can be a very difficult task and each failed attempt can be big wasted potential. This rating gateway helps you to set up even complex conditional triggers that will prompt the user to review the app when all of the trivial conditions are met.
Install via NuGet using:
PM> Install-Package Griesoft.Xamarin.RatingGateway
Make sure that you add this package to each platform that you intend to use it on.
Initialize the rating gateway on application startup as soon as possible with
RatingGateway.Initialize("YourCondition", new BooleanRatingCondition())
You can also add multiple conditions at once by using the overload of the static RatingGateway.Initialize(...)
method.
In the OnCreate
of your startup Activity:
protected override void OnCreate(Bundle savedInstanceState)
{
RatingGateway.Initialize("YourCondition", new BooleanRatingCondition());
}
In the FinishedLaunching
of your AppDelegate:
[Register ("AppDelegate")]
public class AppDelegate : ApplicationDelegate
{
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
RatingGateway.Initialize(new Dictionary<string, IRatingConditions>()
{
{ "FirstCondition", CountRatingCondition(0, 2) },
{ "SecondCondition", BooleanRatingConditions() }
});
return base.FinishedLaunching(application, launchOptions);
}
}
Now that you are all set up, use RatingGateway.Current?.Evaluate()
each time that a user has triggered an event in your application that should prompt them to review your app.
This package has 5 build-in conditions. These conditions do cover many common use cases.
Use it as a switch, to memorize certain actions that your user did in your app.
Use it to count certain actions that your user did in your app. The condition is met by default when the count is equal to or greater than the specified goal.
Use it to mark a certain point in time that needs to be in the past for this condition to be met.
Use it to match strings with each other, like user input for example.
This is a generic condition that can be used to effortlessly create your conditions. Some functionality can be only customized by writing your own condition class thou.
All conditions need to implement the IRatingCondition
interface. You can create custom conditions by implementing it. The best approach to that would be to inherit from the abstract RatingConditionBase
class.
Is on it's why...
Currently this package supports NetStandard, Android 9, Android 10 and iOS.
Contributing is heavily encouraged. The best way of doing so is probably by first start a discussion about new features or improvements, or if you found a bug report it first by creating a new issue first. There you can volunteer to make it your mission to fix it. 😄
Please see the License.