Skip to content

Conversation

@sheiksyedm
Copy link
Contributor

@sheiksyedm sheiksyedm commented Jan 7, 2026

Summary

This PR addresses the issue where Google has paused the Age Signals API, which currently returns error code -1 for all requests.

Changes Made

  • ✅ Updated Age Signals NuGet package from 0.0.1-beta02 to 0.0.2
  • ✅ Integrated FakeAgeSignalsManager from Google.Android.Play.AgeSignals.Testing namespace
  • ✅ Added UseFakeForTesting flag for easy switching between fake and live API
  • ✅ Implemented comprehensive test scenarios with 5 different user states:
    • VERIFIED adult user (18+) - default scenario
    • SUPERVISED user (13-17 years old)
    • UNKNOWN status (not verified)
    • SUPERVISED_APPROVAL_PENDING (awaiting parental approval)
    • SUPERVISED_APPROVAL_DENIED (parental approval denied)

Technical Details

Files Modified

  1. AgeSignals.csproj

    • Updated package version: Xamarin.Google.Android.Play.Age.Signals from 0.0.1-beta02 to 0.0.2
  2. AgeSignalService.Android.cs

    • Added using Google.Android.Play.AgeSignals.Testing; import
    • Added UseFakeForTesting flag (set to true by default)
    • Created CreateFakeAgeSignalsManager() method with configurable test scenarios
    • Updated manager initialization logic to use fake manager when flag is enabled
    • Added appropriate logging to indicate when fake manager is being used

Implementation Details

// Initialization logic
if (UseFakeForTesting)
{
    _ageSignalsManager = CreateFakeAgeSignalsManager();
    _logger.LogWarning("Using FakeAgeSignalsManager - Live API paused by Google (returns error -1)");
}
else
{
    _ageSignalsManager = AgeSignalsManagerFactory.Create(context);
    _logger.LogInformation("Age Signals Manager initialized");
}

Why This Change is Needed

Google has paused the Age Signals API, causing all live requests to return error code -1. This makes the sample non-functional for developers trying to test age verification features.

The FakeAgeSignalsManager provides a working alternative that:

  • Simulates realistic API responses
  • Allows testing different user scenarios
  • Maintains code compatibility with the live API
  • Can be easily switched back when Google re-enables the API

Expected Timeline: Google is expected to launch the live API in May/July 2026

sheiksyedm and others added 3 commits January 7, 2026 13:51
…ogle

- Updated Age Signals package from 0.0.1-beta02 to 0.0.2
- Added FakeAgeSignalsManager implementation as workaround for API pause
- Google has paused live API responses (returns error code -1)
- Added USE_FAKE_FOR_TESTING flag for easy switching
- Included 5 test scenarios for different user states (verified, supervised, unknown, pending, denied)
- Expected Google API live launch: May/July 2026
- Changed USE_FAKE_FOR_TESTING from const to static readonly
- Prevents compiler warning about unreachable code in CI builds
- Maintains same functionality with runtime evaluation
@jfversluis
Copy link
Member

@sheiksyedm any idea why this now starts failing to build?

Building ./10.0/AgeSignals/AgeSignals/AgeSignals.csproj
Determining projects to restore...
Restored /Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/DeclaredAgeRangeWrapperBinding.iOS/DeclaredAgeRangeWrapperBinding.iOS.csproj (in 961 ms).
Restored /Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/AgeSignals/AgeSignals.csproj (in 3.39 sec).
DeclaredAgeRangeWrapperBinding.iOS -> /Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/DeclaredAgeRangeWrapperBinding.iOS/bin/Debug/net10.0-ios/DeclaredAgeRangeWrapperBinding.iOS.dll
/Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.2/26.2.10191/tools/msbuild/Xamarin.Shared.targets(2041,3): error : No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com./ [/Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/AgeSignals/AgeSignals.csproj::TargetFramework=net10.0-ios]
AgeSignals -> /Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/AgeSignals/bin/Debug/net10.0-android/AgeSignals.dll

Build FAILED.

/Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.2/26.2.10191/tools/msbuild/Xamarin.Shared.targets(2041,3): error : No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com./ [/Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/AgeSignals/AgeSignals.csproj::TargetFramework=net10.0-ios]
0 Warning(s)
1 Error(s)

Time Elapsed 00:01:44.12

I checked with the earlier PR and it worked there.

The CI was failing with 'No valid iOS code signing keys found' error
when building for iOS. This occurred because .NET iOS SDK 26.2 on the
macos-26 runner defaults to device builds when no RuntimeIdentifier is
specified, which requires code signing certificates.

Changes:
- Set default RuntimeIdentifier to iossimulator-x64 in the main PropertyGroup
  when TargetFramework is net10.0-ios and no RID is specified
- This ensures the property is set during inner builds for iOS
- Removed redundant iOS simulator code signing configuration
- Developers can still override with -r ios-arm64 for device builds

The original conditional code signing config worked on macos-15 runners
but broke when GitHub Actions upgraded to macos-26 with .NET iOS SDK 26.2,
which has stricter build target defaults.
@sheiksyedm sheiksyedm force-pushed the fix/age-signals-fake-manager branch from 69824c1 to 394dbdb Compare January 7, 2026 17:28
The previous fix set RuntimeIdentifier for the main AgeSignals project,
but the iOS binding project (DeclaredAgeRangeWrapperBinding.iOS) also
needs the same fix since it's built first and was still triggering the
code signing error.

Added default RuntimeIdentifier to iossimulator-x64 in the binding
project when none is specified, matching the fix in the main project.

This ensures both projects build for simulator by default in CI,
avoiding the need for code signing certificates.
@sheiksyedm
Copy link
Contributor Author

@sheiksyedm any idea why this now starts failing to build?

Building ./10.0/AgeSignals/AgeSignals/AgeSignals.csproj Determining projects to restore... Restored /Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/DeclaredAgeRangeWrapperBinding.iOS/DeclaredAgeRangeWrapperBinding.iOS.csproj (in 961 ms). Restored /Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/AgeSignals/AgeSignals.csproj (in 3.39 sec). DeclaredAgeRangeWrapperBinding.iOS -> /Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/DeclaredAgeRangeWrapperBinding.iOS/bin/Debug/net10.0-ios/DeclaredAgeRangeWrapperBinding.iOS.dll /Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.2/26.2.10191/tools/msbuild/Xamarin.Shared.targets(2041,3): error : No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com./ [/Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/AgeSignals/AgeSignals.csproj::TargetFramework=net10.0-ios] AgeSignals -> /Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/AgeSignals/bin/Debug/net10.0-android/AgeSignals.dll

Build FAILED.

/Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.2/26.2.10191/tools/msbuild/Xamarin.Shared.targets(2041,3): error : No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com./ [/Users/runner/work/maui-samples/maui-samples/10.0/AgeSignals/AgeSignals/AgeSignals.csproj::TargetFramework=net10.0-ios] 0 Warning(s) 1 Error(s)

Time Elapsed 00:01:44.12

I checked with the earlier PR and it worked there.

@jfversluis I have fixed this iOS signing issue. The previous code signing config worked on macos-15 runners
but broke when GitHub Actions upgraded to macos-26 with .NET iOS SDK 26.2, which has stricter build target defaults.

PROBLEM: The RuntimeIdentifier was set in the main PropertyGroup with
a condition that checks TargetFramework == 'net10.0-ios', but during
multi-targeted builds, TargetFramework is empty in the outer evaluation.

SOLUTION: Move RuntimeIdentifier to the iOS-specific PropertyGroup that
uses GetTargetPlatformIdentifier() - this evaluates correctly during the
inner build when the iOS target framework is active.

This matches the same pattern used for CodesignEntitlements and ensures
the property is set at the right evaluation phase.
@sheiksyedm sheiksyedm force-pushed the fix/age-signals-fake-manager branch from 0367afd to 3e958c4 Compare January 8, 2026 06:01
sheiksyedm and others added 6 commits January 8, 2026 12:10
SOLUTION: Remove ALL custom RuntimeIdentifier and code signing config
from both the main project and binding project. Let .NET MAUI SDK use
its default behavior, matching how all other samples in the repo work.

WHY THIS WORKS:
- Other samples (Xaminals, DataTemplates, etc.) have NO custom signing
  config and build successfully in CI
- .NET MAUI SDK has built-in defaults that handle iOS builds correctly
- The custom config added originally was unnecessary and causing issues
  with .NET iOS SDK 26.2 behavior changes

REMOVED:
- RuntimeIdentifier settings from both projects
- Conditional code signing configuration

RESULT:
- Android builds: ✅ Success
- iOS binding project builds: ✅ Success
- iOS main project builds: ✅ Success (tested locally, only Xcode version issue)
- Aligns with standard .NET MAUI sample patterns
- Set empty CodesignKey and CodesignProvision to skip certificate validation
- Target iossimulator-arm64 to avoid device signing requirements
- Fixes build errors in CI environments without signing certificates
This property explicitly tells the iOS SDK to skip code signing validation,
which is required for CI builds that target the simulator without certificates.
- Changed from CI to GITHUB_ACTIONS (official GitHub Actions env var)
- Keeps entitlements for local development
- Only disables bundle creation when running in GitHub Actions CI
The iOS build requires code signing certificates not available in CI.
Reverted previous CI-specific signing workarounds as they are no longer needed.
@jfversluis jfversluis merged commit 7ce146a into dotnet:main Jan 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants