{"id":2954,"date":"2025-12-01T18:16:34","date_gmt":"2025-12-01T18:16:34","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2025\/12\/01\/cross-platform-age-verification-in-net-maui-applications\/"},"modified":"2025-12-01T18:16:34","modified_gmt":"2025-12-01T18:16:34","slug":"cross-platform-age-verification-in-net-maui-applications","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2025\/12\/01\/cross-platform-age-verification-in-net-maui-applications\/","title":{"rendered":"Cross-Platform Age Verification in .NET MAUI Applications"},"content":{"rendered":"<p>If you\u2019re building apps that need to comply with upcoming age verification requirements in Texas (January 1, 2026), Utah (May 7, 2026), or Louisiana (July 1, 2026), you might be wondering how to handle age verification across Android, iOS, and Windows. The good news? Each platform provides its own age verification APIs, and we\u2019ve put together a comprehensive sample showing you exactly how to use them in your .NET MAUI applications.<\/p>\n\n<div class=\"alert alert-info\">\n<p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Time-Sensitive Compliance Requirements<\/strong><\/p>\n<p>Apps serving users in Texas, Utah, or Louisiana must implement age verification by their respective deadlines. Non-compliance can result in significant fines and potential app store removal. Texas requires compliance by <strong>January 1, 2026<\/strong>, Utah by <strong>May 7, 2026<\/strong>, and Louisiana by <strong>July 1, 2026<\/strong>.<\/p><\/div>\n<p>Let\u2019s walk through how you can implement age verification that works seamlessly across all three platforms.<\/p>\n<h2>The .NET MAUI Age Verification Sample App<\/h2>\n<p>We\u2019ve created a new <a href=\"https:\/\/github.com\/dotnet\/maui-samples\/tree\/main\/10.0\/AgeSignals\">Age Verification sample<\/a> that shows you exactly how to integrate platform-specific age verification into your .NET MAUI apps. The sample covers all three major platforms:<\/p>\n<ul>\n<li><strong>Android<\/strong>: using the <a href=\"https:\/\/developer.android.com\/google\/play\/age-signals\/overview\">Google Play Age Signals API<\/a><\/li>\n<li><strong>iOS<\/strong>: using the <a href=\"https:\/\/developer.apple.com\/documentation\/declaredagerange\/\">Apple Declared Age Range API<\/a>  <\/li>\n<li><strong>Windows<\/strong>: using the <a href=\"https:\/\/learn.microsoft.com\/uwp\/api\/windows.system.user.checkuserageconsentgroupasync\">Windows Age Consent API<\/a><\/li>\n<\/ul>\n<p>With this sample app you have everything you need to implement this functionality in your own .NET MAUI project should you need it.<\/p>\n<h2>Why This Matters Now<\/h2>\n<p>New regulations are coming fast. Texas law SB 2420 requires apps to verify user ages starting January 1, 2026, with Utah and Louisiana following shortly after. Google Play has responded with the Age Signals API to help developers comply, while Apple and Microsoft have their own age verification systems already in place.<\/p>\n\n<div class=\"alert alert-info\">\n<p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Important Compliance Deadline<\/strong><\/p>\n<p>If your app serves users in Texas, you need to integrate age verification by January 1, 2026. Utah follows on May 7, and Louisiana on July 1. Learn more at <a href=\"https:\/\/support.google.com\/googleplay\/android-developer\/answer\/16569691\">Google Play\u2019s Age Verification Guide<\/a>.<\/p><\/div>\n<h2>How It Works<\/h2>\n<p>The sample follows a straightforward pattern that will feel familiar if you\u2019ve worked with platform-specific code in .NET MAUI before.<\/p>\n<h3>One Interface, Three Implementations<\/h3>\n<p>Everything starts with a simple <code>IAgeSignalService<\/code> interface that defines what age verification looks like, regardless of which platform you\u2019re on:<\/p>\n<pre><code class=\"language-csharp\">public interface IAgeSignalService\n{\n    Task&lt;AgeVerificationResult&gt; RequestAgeVerificationAsync(\n        int minimumAge = 13, \n        object? platformContext = null);\n\n    Task&lt;AgeVerificationResult&gt; RequestAgeVerificationAsync(\n        AgeVerificationRequest request);\n\n    string GetPlatformName();\n}<\/code><\/pre>\n<h3>Three Platform-Specific Files<\/h3>\n<p>Then we have three separate implementation files, one for each platform:<\/p>\n<ul>\n<li><code>AgeSignalService.Android.cs<\/code> \u2013 Talks to Google Play Age Signals<\/li>\n<li><code>AgeSignalService.iOS.cs<\/code> \u2013 Uses Apple\u2019s Declared Age Range API<\/li>\n<li><code>AgeSignalService.Windows.cs<\/code> \u2013 Calls Windows Age Consent<\/li>\n<\/ul>\n<p>The build system automatically picks the right one based on which platform you\u2019re targeting.<\/p>\n<h3>Wire It Up Once<\/h3>\n<p>In <code>MauiProgram.cs<\/code>, register the service and you\u2019re good to go:<\/p>\n<pre><code class=\"language-csharp\">builder.Services.AddSingleton&lt;IAgeSignalService, AgeSignalService&gt;();\nbuilder.Services.AddSingleton&lt;MainPage&gt;();<\/code><\/pre>\n<h2>What Each Platform Does Differently<\/h2>\n<h3>Android: Google Play Age Signals<\/h3>\n<p>Google\u2019s approach is interesting \u2013 their Age Signals API (currently in beta) only returns data in jurisdictions where it\u2019s legally required. You\u2019ll see one of five possible statuses:<\/p>\n<ul>\n<li><strong>VERIFIED<\/strong>: User is 18 or older<\/li>\n<li><strong>SUPERVISED<\/strong>: User has a supervised account with a specific age range<\/li>\n<li><strong>SUPERVISED_APPROVAL_PENDING<\/strong>: Waiting for guardian approval<\/li>\n<li><strong>SUPERVISED_APPROVAL_DENIED<\/strong>: Guardian said no<\/li>\n<li><strong>UNKNOWN<\/strong>: Age information isn\u2019t available<\/li>\n<\/ul>\n<p>If your user is in California or France, for example, the API won\u2019t return anything at this point in time. The API is specifically built for compliance in regions with age verification laws. As local laws change, Google will most likely implement this for other regions in the future as required.<\/p>\n<p>For more information about the Google specifics, read the <a href=\"https:\/\/developer.android.com\/google\/play\/age-signals\/overview\">Google Play Age Signals documentation<\/a>.<\/p>\n<h3>iOS: Apple Declared Age Range<\/h3>\n<p>Apple\u2019s Declared Age Range API is Swift-only, which means we need to do some bridging work because we are busy getting the Swift interop work done. The sample includes an XCFramework that translates between Swift and Objective-C, which then gets bound to .NET. It\u2019s a bit involved, but once it\u2019s set up, it just works. And you can probably just lift the code from the sample repository and put that in your own project.<\/p>\n<p>The API tells you an age range (like 13-17) and whether the user declared it themselves or if a guardian did. One thing to know: this only works on iOS 26.0+ and only on physical devices. The iOS Simulator won\u2019t help you here unfortunately.<\/p>\n<p>For more information about the Apple specifics, read the <a href=\"https:\/\/developer.apple.com\/documentation\/declaredagerange\/\">Apple Declared Age Range documentation<\/a>.<\/p>\n<h3>Windows: Age Consent<\/h3>\n<p>Windows keeps it simple with an Age Consent API that puts users into one of three buckets: Child, Minor, or Adult. How strictly this is enforced depends on where your user is located \u2013 it works best in the EU, US, UK, and Korea.<\/p>\n<p>For more information about the Windows specifics, read the <a href=\"https:\/\/learn.microsoft.com\/uwp\/api\/windows.system.user.checkuserageconsentgroupasync\">Windows Age Consent API documentation<\/a>.<\/p>\n<h2>Try It Yourself<\/h2>\n<p>Ready to see it in action? Here\u2019s what you need to do:<\/p>\n<ol>\n<li>Head over to the <a href=\"https:\/\/github.com\/dotnet\/maui-samples\/tree\/main\/10.0\/AgeSignals\">.NET MAUI Samples repository<\/a> and grab the code<\/li>\n<li>Check out the README for platform-specific setup (iOS needs a few extra steps)<\/li>\n<li>Build and run on whichever platform you\u2019re targeting<\/li>\n<\/ol>\n<p>The sample includes everything you need to know about setup, building, testing, and troubleshooting.<\/p>\n<h2>What You Need for Each Platform<\/h2>\n<p>Before you dive in, here\u2019s what each platform requires:<\/p>\n<p><strong>Android<\/strong>:<\/p>\n<ul>\n<li>Google Play Store on your device<\/li>\n<li>Android 6.0 (API 23) or newer<\/li>\n<li>The <code>Xamarin.Google.Android.Play.Age.Signals<\/code> NuGet package (v0.0.1-beta02)<\/li>\n<li>Remember: only works in jurisdictions where it\u2019s required by law<\/li>\n<\/ul>\n<p><strong>iOS<\/strong>:<\/p>\n<ul>\n<li>iOS 26.0 or later<\/li>\n<li>A real device (Simulator won\u2019t work)<\/li>\n<li>The <code>com.apple.developer.declared-age-range<\/code> entitlement<\/li>\n<li>Family Sharing configured on the device<\/li>\n<li>XCFramework binding for the Swift API<\/li>\n<\/ul>\n<p><strong>Windows<\/strong>:<\/p>\n<ul>\n<li>Windows 11 Build 22000 or later<\/li>\n<li><code>UserAccountInformation<\/code> capability in your manifest<\/li>\n<li>Note that enforcement varies by region<\/li>\n<\/ul>\n<h2>Things to Keep in Mind<\/h2>\n<p>A few important points as you build this into your app:<\/p>\n<ol>\n<li><strong>Know your jurisdictions<\/strong>: Not every region requires age verification. Make sure you understand where your app needs it.<\/li>\n<li><strong>Explain to users<\/strong>: Be clear about why you\u2019re asking for age verification. Users are more cooperative when they understand the reason.<\/li>\n<li><strong>Handle failures gracefully<\/strong>: Age verification might not be available everywhere. Your app should still work when it fails.<\/li>\n<li><strong>Respect privacy<\/strong>: Use this data only for compliance. It\u2019s not for targeting ads or analytics.<\/li>\n<li><strong>Test on real devices<\/strong>: Especially for iOS, you need physical devices in the right regions to properly test.<\/li>\n<\/ol>\n<div class=\"alert alert-primary\">\n<p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Google Play Age Signals Beta<\/strong><\/p>\n<p>The Android Age Signals API is still in beta. It\u2019s ready for production apps that need compliance, but Google might tweak things as they refine the implementation.<\/p><\/div>\n<h2>More Resources<\/h2>\n<p>If you need more information on one of these topics, you can read up on these links here:<\/p>\n<ul>\n<li><a href=\"https:\/\/aka.ms\/maui-samples\">Age Verification Sample<\/a> \u2013 Full source code<\/li>\n<li><a href=\"https:\/\/developer.android.com\/google\/play\/age-signals\/overview\">Google Play Age Signals API<\/a> \u2013 Android docs<\/li>\n<li><a href=\"https:\/\/support.google.com\/googleplay\/android-developer\/answer\/16569691\">Google Play Compliance Guide<\/a> \u2013 State law details<\/li>\n<li><a href=\"https:\/\/developer.apple.com\/documentation\/declaredagerange\/\">Apple Declared Age Range API<\/a> \u2013 iOS docs<\/li>\n<li><a href=\"https:\/\/developer.apple.com\/videos\/play\/wwdc2024\/10178\/\">WWDC 2024 Session<\/a> \u2013 Apple\u2019s presentation on Declared Age Range<\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/uwp\/api\/windows.system.user.checkuserageconsentgroupasync\">Windows Age Consent API<\/a> \u2013 Windows docs<\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/dotnet\/maui\/\">.NET MAUI Documentation<\/a> \u2013 Everything .NET MAUI<\/li>\n<\/ul>\n<p>We hope this sample helps you get age verification working in your apps before those compliance deadlines hit. Questions? Drop them in the comments below!<\/p>\n<p>The post <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/cross-platform-age-verification-dotnet-maui\/\">Cross-Platform Age Verification in .NET MAUI Applications<\/a> appeared first on <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\">.NET Blog<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>If you\u2019re building apps that need to comply with upcoming age verification requirements in Texas (January 1, 2026), Utah (May [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":94,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-2954","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/2954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=2954"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/2954\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media\/94"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=2954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=2954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=2954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}