Skip to content

PatGet/XamarinPlayCoreUpdater

Repository files navigation

Play.Core Library Bindings for Xamarin.Android

NuGet

This repo contains a NuGet package that allows you to Support in-app updates and in-app reviews in your Xamarin Forms Android Apps.

Screenshots

In-App Review

In-App Updates

Update Prompt Update in Progress

Download

Implementation

  • 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.

Google Guidelines

Possible Pitfalls

  • 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.