Skip to content

Releases: Sritejathuraka/AgeGatingKit

AgeGatingKit iOS v1.0.2

Choose a tag to compare

@Sritejathuraka Sritejathuraka released this 19 Aug 16:12

AgeGatingKit iOS v1.0.2

Native iOS support for AgeGatingKit — an open-source SDK that simplifies Apple's age assurance, regulatory features, parental consent, and significant app change APIs.

This release includes a complete UIKit example project demonstrating the recommended AgeGatingKit integration flow.

✨ What's Included

  • Apple Declared Age Range integration
  • Age feature eligibility detection
  • Age range retrieval
  • Regulatory feature reporting
  • Parental consent support for significant app changes
  • Parent approval / denial response observation
  • Adult notification support
  • Swift Concurrency (async/await)
  • Swift Package Manager support
  • Complete UIKit example application

📦 Installation

Swift Package Manager

In Xcode:

  1. Open your project.
  2. Select File → Add Package Dependencies.
  3. Enter the AgeGatingKit repository URL:

https://github.com/Sritejathuraka/AgeGatingKit.git

  1. Select version 1.0.2.
  2. Add AgeGatingKit to your application target.

Then import the package:

import AgeGatingKit

⚙️ Required iOS Configuration

Add the Declared Age Range capability to your application target:

Target → Signing & Capabilities → + Capability → Declared Age Range

Make sure your application is properly configured for Apple's age-related APIs before calling AgeGatingKit.


🚀 Integration Flow

The recommended integration flow is:

Check Age
    ↓
Check Eligibility
    ↓
Read Age Range
    ↓
Inspect Regulatory Features
    ↓
Request Parental Consent (if required)
    ↓
Observe Parent Decision
    ↓
Show Adult Notification (if required)

1️⃣ Check Age

Start by calling:

let result = try await AgeGating.check(
    ageGates: [13, 16, 18],
    presentingViewController: self
)

AgeGatingResult provides:

result.isEligibleForAgeFeatures
result.ageRange
result.regulatoryFeatures

The age gates [13, 16, 18] are an example. Applications should provide the age thresholds appropriate for their own product.


2️⃣ Check Eligibility

Before using the returned age information, check whether age features are available:

guard result.isEligibleForAgeFeatures == true else {
    // Age features are unavailable.
    // Apply your application's fallback behavior.
    return
}

isEligibleForAgeFeatures is optional, so applications can also explicitly handle all states:

switch result.isEligibleForAgeFeatures {

case true:
    print("Age features available")

case false:
    print("Age features unavailable")

case nil:
    print("Eligibility unknown")
}

3️⃣ Read Age Range

When available, AgeGatingKit returns the age range provided by the platform:

if let ageRange = result.ageRange {

    let lowerBound = ageRange.lowerBound
    let upperBound = ageRange.upperBound

    print("Lower Bound:", lowerBound as Any)
    print("Upper Bound:", upperBound as Any)
}

Either boundary may be unavailable depending on the range returned by the platform.

Your application should use this result according to its own age-gating requirements.


4️⃣ Check Regulatory Features

After checking eligibility, inspect the regulatory features:

guard let features = result.regulatoryFeatures else {
    return
}

AgeGatingKit exposes:

features.declaredAgeRangeRequired

features.significantAppChangeRequiresParentalConsent

features.significantAppChangeRequiresAdultNotification

These values tell your application which platform flows are required for the current user and regulatory context.


👶 Declared Age Range Required

Check:

if features.declaredAgeRangeRequired {
    // Declared age range handling is required.
}

👨‍👩‍👧 Parental Consent Required

If:

features.significantAppChangeRequiresParentalConsent == true

request parental consent:

try await AgeGating.requestSignificantAppUpdatePermission(
    description: "Parental consent required for changes in the latest release.",
    presentingViewController: self
)

The parental decision may arrive asynchronously.

Calling this method starts the parental consent flow; it should not be treated as the final approval result.


👀 Observe Parent Decision

Listen for parental consent responses:

for await response in AgeGating.significantAppUpdateResponses() {

    switch response.decision {

    case .approved:
        print("Parent approved")

    case .denied:
        print("Parent denied")

    case .unknown:
        print("Parent decision unknown")

    @unknown default:
        print("Unrecognized parent decision")
    }
}

For example, an application can keep an observation task:

private var responseTask: Task<Void, Never>?

private func observeParentalConsentResponses() {

    responseTask = Task {

        for await response in
            AgeGating.significantAppUpdateResponses() {

            switch response.decision {

            case .approved:
                // Parent approved the request.
                break

            case .denied:
                // Parent denied the request.
                break

            case .unknown:
                break

            @unknown default:
                break
            }
        }
    }
}

Cancel the observation when it is no longer needed:

deinit {
    responseTask?.cancel()
}

🔔 Adult Notification Required

If:

features.significantAppChangeRequiresAdultNotification == true

show the adult notification:

try await AgeGating.showSignificantAppUpdateAdultNotification(
    description: "Please review changes in the latest release.",
    presentingViewController: self
)

🧩 Complete Integration Example

do {

    let result = try await AgeGating.check(
        ageGates: [13, 16, 18],
        presentingViewController: self
    )

    guard result.isEligibleForAgeFeatures == true else {
        return
    }

    // Age Range

    if let ageRange = result.ageRange {
        print("Lower Bound:", ageRange.lowerBound as Any)
        print("Upper Bound:", ageRange.upperBound as Any)
    }

    // Regulatory Features

    guard let features = result.regulatoryFeatures else {
        return
    }

    print(
        "Declared Age Range Required:",
        features.declaredAgeRangeRequired
    )

    // Parental Consent

    if features.significantAppChangeRequiresParentalConsent {

        try await AgeGating.requestSignificantAppUpdatePermission(
            description:
                "Parental consent required for changes in the latest release.",
            presentingViewController: self
        )
    }

    // Adult Notification

    if features.significantAppChangeRequiresAdultNotification {

        try await AgeGating.showSignificantAppUpdateAdultNotification(
            description:
                "Please review changes in the latest release.",
            presentingViewController: self
        )
    }

} catch {

    print("AgeGatingKit Error:", error)
}

Note: Parental consent responses are asynchronous. Use AgeGating.significantAppUpdateResponses() to observe the parent's final decision.


🧪 Example iOS Application

A complete UIKit example application is included in the repository:

examples/
└── example-ios/
    └── example-age-gating-iOS/

The example demonstrates:

  • Checking age eligibility
  • Displaying the returned age range
  • Displaying regulatory feature flags
  • Requesting parental consent
  • Waiting for parent approval or denial
  • Observing asynchronous parental responses
  • Showing adult notifications when required
  • Loading states
  • Error handling
  • Recommended AgeGatingKit integration flow

Run the Example

Clone the repository:

git clone https://github.com/Sritejathuraka/AgeGatingKit.git

Then open:

examples/example-ios/example-age-gating-iOS/
example-age-gating-iOS.xcodeproj

Configure your development team and required capabilities, then build and run on a supported device.


⬇️ Download iOS Example

A standalone iOS example project is also available in the Assets section of this release.

Download:

AgeGatingKit-iOS-Example-v1.0.2.zip

Unzip the project and open:

example-age-gating-iOS.xcodeproj

This allows developers to explore AgeGatingKit without cloning the complete repository.


⚠️ Important

AgeGatingKit provides a simplified interface to platform-provided age assurance and regulatory signals.

Applications remain responsible for determining:

  • Appropriate age thresholds
  • Which functionality should be allowed or restricted
  • Fallback behavior when age information is unavailable
  • Compliance with applicable laws and regulations
  • Compliance with Apple platform policies

AgeGatingKit is a developer tool and does not constitute legal advice.


📄 License

AgeGatingKit is released under the MIT License.


Built for developers integrating age-aware experiences on iOS.

AgeGatingKit — one API for age assurance across iOS, Android, and Flutter.

AgeGatingKit Flutter v1.0.0

Choose a tag to compare

@Sritejathuraka Sritejathuraka released this 18 Aug 19:00

AgeGatingKit Flutter v1.0.0

AgeGatingKit is a cross-platform Flutter plugin that provides a unified API for integrating platform-provided age assurance and age-gating capabilities on iOS and Android.

This is the first public release of the AgeGatingKit Flutter plugin.

The plugin provides a Flutter-friendly abstraction over Apple's age-related APIs and Android's age signals, allowing applications to make age-appropriate access decisions while keeping platform-specific implementation details behind a consistent Dart API.


✨ Features

Cross-Platform Age Gating

Use a single Flutter API to retrieve age-related signals from the underlying platform.

AgeGatingKit handles the communication between Flutter and the native iOS and Android implementations.

🍎 iOS Support

Integration with Apple's age-related APIs, including:

  • Declared Age Range
  • Age feature eligibility
  • Regulatory feature information
  • Parental consent requests
  • Significant app update / adult notification flows

The plugin exposes the platform-provided results to Flutter so applications can apply their own age-gating and access policies.

🤖 Android Support

Integration with Android age signals to retrieve available age-related information and regulatory requirements.

The Android implementation exposes the platform response through the same Flutter API used by iOS.

👨‍👩‍👧 Parental Consent

Applications can initiate the supported parental consent flow when the platform indicates that parental authorization is required.

🔔 Adult Notification / Significant Changes

Applications can trigger the supported platform flow for notifying an adult or acknowledging significant application changes when required.

🛡️ Regulatory Feature Reporting

AgeGatingKit exposes regulatory feature information returned by the underlying platform so applications can determine whether additional actions are required.


📦 Installation

Add AgeGatingKit to your Flutter project's pubspec.yaml:

dependencies:
  age_gating_kit: ^1.0.0

Then install the dependency:

flutter pub get

Import the package:

import 'package:age_gating_kit/age_gating_kit.dart';

🚀 Basic Usage

Use AgeGatingKit to request the available age-gating information from the current platform.

final result = await AgeGatingKit.checkAgeGate();

The returned result can be used by your application to determine the appropriate experience based on the age information and regulatory features provided by the operating system.

The exact information available depends on the platform, OS version, account configuration, region, and platform eligibility.


🔐 Privacy

AgeGatingKit is designed to rely on age-related signals provided by the operating system rather than requiring applications to directly collect a user's date of birth.

The library does not provide its own identity verification service and does not independently determine a user's age.

Developers are responsible for determining how platform-provided signals should be used within their application and for complying with applicable laws, platform policies, and regulatory requirements.


📱 Supported Platforms

Platform Support
iOS ✅ Supported
Android ✅ Supported
Flutter ✅ Unified API

Some functionality depends on platform APIs and may only be available on supported operating-system versions and eligible accounts/devices.


⚠️ Important

AgeGatingKit provides an abstraction over platform-provided age signals.

It does not guarantee regulatory compliance by itself.

Applications integrating the library are responsible for:

  • Defining their own age-gating policies
  • Handling unavailable or indeterminate age signals
  • Applying appropriate access restrictions
  • Handling parental consent requirements
  • Following Apple and Google platform requirements
  • Complying with applicable laws and regulations

📖 Documentation

See the repository README for installation instructions, platform configuration, API usage, and implementation examples.


📝 Release

Version: 1.0.0
Flutter tag: flutter-v1.0.0

This release introduces the initial Flutter implementation of AgeGatingKit for iOS and Android.


📄 License

AgeGatingKit is available under the MIT License.