This repo contains a NuGet package that allows you to Support in-app updates and in-app reviews in your Xamarin Forms Android Apps.
Update Prompt | Update in Progress |
---|---|
- Install the Nuget package into your Android project
- If you are having crashes in your release build or if you set the Linker Behavior of your Android project to "Link SDK assemblies only", then you will need to add this to your proguard file:
-keep class com.google.android.play.core.review.** { *; }
-keep class com.google.android.play.core.appupdate.** { *; }
-keep class com.google.android.play.core.tasks.** { *; }
- To support In-App Updates, you need to modify
MainActivity.cs
to initialise the IAppUpdateManager and define the OnSuccessListener. - To support In-App Reviews, you need to use Dependency Injection to call the Review workflow from your Shared Project. Add an interface in the Shared Project and implement that interface in your Android project.
- Although optional, using James Montemagno's Current Activity Plugin is recommended to retrieve the Context for the IReview object. Alternatively, the Sample uses a static object to pass the Context to the IAppReview implementation or you can use a singleton.
To make it easier for you, check the Sample project to see examples of implementations for both features.
- See Android's Official Play Core In-App-Updates docs for more info on In-App Updates guidelines.
- See Android's Official Play Core In-App-Review docs for info on In-App Reviews guidelines.
-
You need to have the app submitted to at least an internal test track or internal app sharing to fully test the features.
-
If you use Google App signing, you can only test the update process with an app from the store and an update from the store. You can just disable automatic app updates, wait for the new version to appear in the Play Store and than manually start your App.
-
If you test in-app reviews with an app submitted to Internal App Sharing, the Submit button for the review will be grayed out. This is also clearly stated in the Google docs.