Jc.AppRating.Avalonia.Android 1.0.0-preview100

This is a prerelease version of Jc.AppRating.Avalonia.Android.
dotnet add package Jc.AppRating.Avalonia.Android --version 1.0.0-preview100
                    
NuGet\Install-Package Jc.AppRating.Avalonia.Android -Version 1.0.0-preview100
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Jc.AppRating.Avalonia.Android" Version="1.0.0-preview100" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jc.AppRating.Avalonia.Android" Version="1.0.0-preview100" />
                    
Directory.Packages.props
<PackageReference Include="Jc.AppRating.Avalonia.Android" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Jc.AppRating.Avalonia.Android --version 1.0.0-preview100
                    
#r "nuget: Jc.AppRating.Avalonia.Android, 1.0.0-preview100"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Jc.AppRating.Avalonia.Android@1.0.0-preview100
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Jc.AppRating.Avalonia.Android&version=1.0.0-preview100&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Jc.AppRating.Avalonia.Android&version=1.0.0-preview100&prerelease
                    
Install as a Cake Tool

Jc.AppRating.Avalonia

Library to bring App store app ratings to Avalonia mobile projects.


Table of Contents

Introduction

Jc.AppRating.Avalonia is a library to bring app store rating services to Avalonia Android and iOS projects.

This includes the in-app rating functionality for Android and iOS as well as the ability to open the app store page for the app to review.

Requirements

This version requires .NET 10 and Avalonia 12.1.4 or later within the 12.x series, plus the Android and/or iOS .NET workloads. .NET 9 and Avalonia 11 are no longer supported by this version; use an earlier package version for those targets. The public rating API and package IDs are unchanged.

Android development requires the Android SDK supported by the installed .NET 10 workload. iOS development requires macOS and the Xcode version required by the installed iOS workload. Android now requires API 23 (Android 6.0) because the upgraded AndroidX dependencies no longer support API 21. iOS now requires iOS 15.0, the minimum supported by the current .NET 10 iOS workload.

CI uses the macOS 26 runner with Xcode 26.6 and workload set 10.0.401 to keep those toolchain versions compatible. Newer workloads may require a newer Xcode.

Usage

To use Jc.AppRating.Avalonia you must add the Jc.AppRating.Avalonia package to your cross-platform project.

dotnet add package Jc.AppRating.Avalonia

Followed by adding the Android/iOS Jc.AppRating.Avalonia.xxx package to the platform specific project(s).

dotnet add package Jc.AppRating.Avalonia.Android
dotnet add package Jc.AppRating.Avalonia.iOS

Register AppRating in the platform startup code.

Android registration

Avalonia 12 configures the app in an AvaloniaAndroidApplication<App> subclass:

using Android.App;
using Android.Runtime;
using Avalonia;
using Avalonia.Android;
using Jc.AppRating.Avalonia.Android;

[Application]
public class AndroidApp : AvaloniaAndroidApplication<App>
{
    public AndroidApp(IntPtr javaReference, JniHandleOwnership transfer)
        : base(javaReference, transfer) { }

    protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
        => base.CustomizeAppBuilder(builder).UseAppRating();
}

The main activity inherits from the non-generic AvaloniaMainActivity. Initialize MAUI Essentials in its OnCreate override so review requests can find the current activity:

protected override void OnCreate(Android.OS.Bundle? savedInstanceState)
{
    base.OnCreate(savedInstanceState);
    Microsoft.Maui.ApplicationModel.Platform.Init(this, savedInstanceState);
}

In the shared application's OnFrameworkInitializationCompleted, handle IActivityApplicationLifetime before ISingleViewApplicationLifetime and assign MainViewFactory to create a new view and view model per activity. See the sample for a complete startup implementation.

iOS registration

Register in the AvaloniaAppDelegate<App> subclass in AppDelegate.cs:

using Jc.AppRating.Avalonia.iOS;

protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
    => base.CustomizeAppBuilder(builder).UseAppRating();

Finally, you can access the methods like so:

// Subscribe to error events (when either method fails to execute)
AppRating.Current.OnError += (sender, error)
          => Console.WriteLine(error.Message);

// Open an in-app rating dialog
AppRating.Current.RequestInAppRatingAsync();
// Open the respective store app on the rating page
AppRating.Current.RequestInStoreRatingAsync("appId");

iOS

In development, the review dialog will appear for you, but will not submit reviews.

Note: The dialog will not appear when the app is downloaded via TestFlight.

<img alt="iOS Banner" src="img/ios-in-app.png" width="250" />

Android

In development, the review dialog will not appear for you... It can only be tested via an internal test track. You can see more information around that here.

Note: In production, the dialog will also not always show due to Google's crazy policies. It seems to be affected by a variety of factors, including quotas, whether you've had a recent review, and whether you've had a recent update, so who knows...

Product Compatible and additional computed target framework versions.
.NET net10.0-android36.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview100 100 10/16/2026
0.2.0 249 7/30/2025
0.1.0 582 7/24/2025