Cross-Platform Age Verification in .NET MAUI Applications
Gerald Versluis presents a comprehensive guide to implementing age verification across Android, iOS, and Windows in .NET MAUI apps, with details on meeting upcoming legal compliance requirements.
Cross-Platform Age Verification in .NET MAUI Applications
Overview
New legislation in Texas (Jan 1, 2026), Utah (May 7, 2026), and Louisiana (July 1, 2026) requires apps to verify user ages. This guide walks you through building age verification in your .NET MAUI apps using platform-specific APIs for Android, iOS, and Windows, supported by a sample repository to accelerate development.
Legal Compliance Deadlines
- Texas: January 1, 2026
- Utah: May 7, 2026
- Louisiana: July 1, 2026
Non-compliance may lead to fines and app store removal.
Platforms & APIs
- Android: Google Play Age Signals API — returns age status (VERIFIED, SUPERVISED, etc.) based on jurisdiction.
- iOS: Apple Declared Age Range API — provides age range and verification status (works only on iOS 26.0+ and requires bridging between Swift and .NET).
- Windows: Windows Age Consent API — categorizes users as Child, Minor, or Adult.
Implementation in .NET MAUI
Unified Interface
Define a IAgeSignalService to abstract platform APIs:
public interface IAgeSignalService {
Task<AgeVerificationResult> RequestAgeVerificationAsync(int minimumAge = 13, object? platformContext = null);
Task<AgeVerificationResult> RequestAgeVerificationAsync(AgeVerificationRequest request);
string GetPlatformName();
}
Platform-Specific Services
Use conditional files like AgeSignalService.Android.cs, AgeSignalService.iOS.cs, and AgeSignalService.Windows.cs to handle API integration. The build system selects the right implementation for each target platform.
Dependency Registration
Register your service in MauiProgram.cs:
builder.Services.AddSingleton<IAgeSignalService, AgeSignalService>();
builder.Services.AddSingleton<MainPage>();
Platform Requirements
- Android: Device with Google Play Store, Android 6.0+,
Xamarin.Google.Android.Play.Age.SignalsNuGet package. Works only in necessary jurisdictions. - iOS: iOS 26.0+, real device,
com.apple.developer.declared-age-rangeentitlement, Family Sharing, XCFramework bindings for Swift-to-.NET interop. - Windows: Windows 11+ (Build 22000+),
UserAccountInformationcapability in your manifest.
Usage Considerations
- Know the legal requirements for your app users’ locations.
- Clearly explain why age verification is needed to end users.
- Design for graceful failure if age verification is unavailable.
- Use collected data solely for compliance, not for analytics or ads.
- Test on actual devices, as simulators do not support all platform-specific APIs (especially for iOS).
Links & Resources
- Sample Repository
- Google Play Age Signals API
- Google Play Compliance Guide
- Apple Declared Age Range API
- WWDC 2024 Session
- Windows Age Consent API
- .NET MAUI Documentation
Final Notes
The sample provides guidance and ready-to-use code for your projects. Pay attention to regional laws and deadlines. For questions, consult the provided documentation and reach out in community forums.
This post appeared first on “Microsoft .NET Blog”. Read the entire article here