In-app store reviews
We added support for in-app store reviews.
What we did?
In our Core module, we installed Plugin.StoreReview nuget package. This package needs to be installed in platform projects also.
Next, we added a new interface and his implementation, where we called Plugin.StoreReview's method.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace AssecoSEE.DEM.Core
{
public interface IAppRating : IApplicationService
{
Task RequestReview(bool testMode);
}
}
using Plugin.StoreReview;
using System.Threading.Tasks;
namespace AssecoSEE.DEM.Core.Services
{
public class AppRating : IAppRating
{
public AppRating()
{
}
public async Task RequestReview(bool testMode)
{
await CrossStoreReview.Current.RequestReview(testMode);
}
}
}
As always, there must exist registration, for this is done in ApplicationBase.cs, like for other core's services.
protected virtual List<ITypeInfo> RegisterRequiredTypes()
{
List<ITypeInfo> items = new List<ITypeInfo>() {
...,
new AppServiceInfo<AppRating, IAppRating>()
};
...
}
What you should do?
If you want to add this feature for a specific bank, you'll need to update our core package in all csprojs. First version that supports in-app reviews is 650.
You'll also need to install Plugin.StoreReview in your shared csproj and your platform specific csprojs.
Then you just call our method wherever you want.
await App.ResolveService<IAppRating>().RequestReview(false);
Testing
Testing is the most trickiest thing about this implementation.
For iOS, on test, the review dialog will show always, while on production, when the application is on store, Apple decides when and how many times the dialog will be displayed (maximum three or four times for a year, as we read).
But for Android, you must upload you app for internal testing if the app for this bank is not on PlayStore. If it is, you can test locally with package name of that app that is on PlayStore, but note that even then you won't see the dialog everytime like for iOS testing. Android system will decide when and how many times the review dialog will be shown, but you should see it for the first time at least.