.NET MAUI
Requirements
LicenseSpring.NetSDK 8.2.0 or later.
.NET MAUI workloads.
dotnet workload install mauifrom an elevated prompt.dotnet workload listthen showsandroid,iosandmaui-windows.For the Android head, a JDK 17 or newer, the Android build needs
jar, so a JRE is not enoughand an Android SDK platform matching your target framework, plus
platform-tools.
For the iOS head, a Mac to link and package a runnable app.
Adding the SDK
Add the package to your MAUI project:
<ItemGroup>
<PackageReference Include="LicenseSpring.NetSDK" Version="8.2.0" />
</ItemGroup>Or from the CLI:
dotnet add package LicenseSpring.NetSDKThe package supplies the native hardware-ID library for the platform being built and deploys it alongside your app. On iOS it links the library slice matching what you are building, for both device and simulator builds.
Target frameworks
Each MAUI target framework uses the SDK assembly for its base .NET version:
net8.0-android, net8.0-ios, net8.0-windows10.0.19041.0
net8.0
net9.0-android, net9.0-ios, net9.0-windows10.0.19041.0
net9.0
net10.0-android, net10.0-ios, net10.0-windows10.0.19041.0
net10.0
Earlier MAUI target frameworks resolve the same way, against the net6.0 and net7.0 assemblies.
The sample sets these SupportedOSPlatformVersion values, which are a working starting point:
Platform
SupportedOSPlatformVersion
iOS
15.0
Android
21.0
Windows
10.0.17763.0
Device ID
An activation is bound to a device ID. Select the algorithm and read Configuration.HardwareID; the SDK resolves the value on all three heads and caches it into ExtendedOptions.HardwareID.
What DeviceIDAlgorithm.HardwareIdGeneratorDefault resolves per head:
Windows
Computer System Product ID (SMBIOS UUID)
Android
Derived from Settings.Secure.ANDROID_ID
iOS
Resolved through the native library included in the package
On Android, plan for one platform behaviour before you ship: since Android 8.0, ANDROID_ID is scoped to your app's signing key, and it is reset by a factory reset. Changing signing keys (debug to release, or a Play App Signing key rotation) therefore changes the device ID, and licenses activated under the previous key have to be reactivated. For the same reason, the value your app sees differs from the one adb shell settings get secure android_id reports.
Activating a license
Initialize the license manager once, then activate:
On later runs, the license already on the device is available from CurrentLicense(). A local check validates it without a network call, which suits app start-up on a mobile device; Check() re-validates it against the LicenseSpring platform.
Sample application
The distribution zip contains samples/MauiSample - a MAUI app covering configuration, activation, license check, consumption and deactivation on Android, iOS and Windows, with its own README for building and running each head.
Coming from Xamarin.Forms
.NET MAUI is the successor to Xamarin.Forms, which Microsoft stopped supporting in May 2024. Start new cross-platform work from samples/MauiSample; it keeps the page decomposition of samples/XamarinSample: a tabbed activation screen, plus separate license-info, settings and product-details pages, so the two line up screen for screen while you migrate.
Last updated
Was this helpful?