Skip to content

oscoreio/Maui.InAppReviews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maui.InAppReviews

Nuget package CI/CD License: MIT

NuGet package that implementing native In-App Reviews for MAUI with debugging capabilities. InAppReviews

In-app reviews supported on Android 5.0 (API level 21) & iOS 10.3+ & Windows devices.
It can return ReviewStatus.NotSupported, in this case you can use AppStoreInfo to open review page in the store.

Usage

  • Add NuGet package to your project:
<PackageReference Include="Oscore.Maui.InAppReviews" Version="1.0.0" />
  • Add the following to your MauiProgram.cs CreateMauiApp method:
builder
    .UseMauiApp<App>()
+   .UseInAppReviews()
    .ConfigureFonts(fonts =>
    {
        fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
        fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
    });
ReviewStatus status = await InAppReview.Current.RequestAsync();

Links

Android code shrinker (Proguard & r8)

If you use the plugin with Link SDK assemblies only/Link all, you have to do the following:

  1. Create a proguard.txt file in your android project and add the following:
    -keep class com.google.android.play.core.common.PlayCoreDialogWrapperActivity
    -keep class com.google.android.play.core.review.** { *; }
    -keep class com.google.android.play.core.tasks.** { *; }
  1. Include it to your project
  2. Properties > Build Action > ProguardConfiguration
  3. Go to you Android project options and set your Code Shrinker to ProGuard or r8

Testing & Debugging issues

iOS

  • You cannot submit a review on iOS while developing, but the review popup dialog displays in your simulator/device.
  • However, when you download the app from Testflight, the popup dialog does not display at all, as mentioned here:

When you call this method while your app is still in development mode, a rating/review request view is always displayed so that you can test the user interface and experience. However, this method has no effect when you call it in an app that you distribute using TestFlight."

Android

  • Unlike iOS, you cannot see the review popup dialog while developing or if you distribute it manually. As you can see here, you have to download the app from the Play Store to see the popup. I recommend using Android Play Store's “Internal App Sharing” feature to test.
  • Occasionally, some devices may not show the popup at all as seen here. One way to test whether your device is affected by it, is by downloading this game that uses v3.1 of this nuget, target SDK version 30, target framework v11.0 and win the game once to see the popup. Additionally, you can debug the error using adb locat, as you can see here
  • The most common issue/crash type is that developers release the app in the release configuration but they only test in the debug configuration. They do not realize that they have set Linker behavior to Link SDK assemblies only/Link all, and did not follow the proguard steps mentioned above

About

NuGet package that implementing native In-App Reviews within a MAUI application with debugging capabilities

Topics

Resources

License

Stars

Watchers

Forks

Languages