-
Notifications
You must be signed in to change notification settings - Fork 0
home
Welcome to the Play Age Signals extension wiki!
Play Age Signals is a GameMaker extension that integrates the Google Play Age Signals API.
The API allows the application to retrieve signals about the user's age category and supervision status. This is useful for:
- Compliance with child protection regulations
- Restricting features for minors
- Enabling parental supervision flows
- Adjusting content based on age range
The extension supports:
- Real Play Age Signals API
- FakeAgeSignalsManager for testing (see play_age_signals_test_use_fake_manager)
-
Age signals may only be available for users in supported regions.
-
Some devices may return
API_NOT_AVAILABLEif the Play services version is too old.
Basic example of usage:
if (play_age_signals_init())
{
play_age_signals_check(function(result)
{
if (!result.success)
{
show_debug_message("Error: " + result.error_message);
return;
}
switch (result.status)
{
case PlayAgeSignalsVerificationStatus.Verified:
show_debug_message("Adult verified");
break;
case PlayAgeSignalsVerificationStatus.Supervised:
show_debug_message("Supervised user");
break;
}
});
}This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.
- play_age_signals_init
- play_age_signals_is_available
- play_age_signals_check
- play_age_signals_test_use_fake_manager
- play_age_signals_test_set_result
- play_age_signals_test_set_error
This module offers a collection of structs, which serve as custom data models for organizing and structuring data. Explore the provided structs to better understand the relationships between data elements and simplify your data manipulation tasks.
This module includes a set of predefined constants that can be utilized for various purposes. Browse through the available constants to find values relevant to your needs and enhance the efficiency of your code.
Initializes the Play Age Signals manager. Returns whether the initialisation was successful.
Syntax:
play_age_signals_init()
Returns:
Example:
if (play_age_signals_init())
{
show_debug_message("Age Signals initialized");
}Checks if the API manager is available.
Syntax:
play_age_signals_is_available()
Returns:
Example:
if (play_age_signals_is_available())
{
show_debug_message("API available");
}Requests the age signals information. This is an asynchronous call. You must pass a callback function, which receives a PlayAgeSignalsResult struct when it is called.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Callback.
Syntax:
play_age_signals_check(callback)
| Argument | Type | Description |
|---|---|---|
| callback | Function |
Returns:
N/A
Triggers:
| Key | Type | Description |
|---|---|---|
| result | PlayAgeSignalsResult | The result fo the requested check. |
Example:
play_age_signals_check(function(result)
{
if (!result.success)
{
show_debug_message("Age Signals error: " + string(result.error_code));
return;
}
show_debug_message("Status: " + string(result.status));
show_debug_message("Age lower: " + string(result.age_lower));
show_debug_message("Age upper: " + string(result.age_upper));
});
/// Example result (success):
{
success: true,
status: PlayAgeSignalsVerificationStatus.Verified,
age_lower: 18,
age_upper: 120,
approval_date_ms: -1,
install_id: "abc123",
error_code: PlayAgeSignalsErrorCode.NoError,
error_message: ""
}
/// Example result (failure):
{
success: false,
status: PlayAgeSignalsVerificationStatus.None,
age_lower: -1,
age_upper: -1,
approval_date_ms: -1,
install_id: "",
error_code: PlayAgeSignalsErrorCode.ApiNotAvailable,
error_message: "Age Signals API not available"
}Enables or disables the FakeAgeSignalsManager module. This is used for testing the signals API without having to use a real production environment.
Syntax:
play_age_signals_test_use_fake_manager(enable)
| Argument | Type | Description |
|---|---|---|
| enable | Boolean |
Returns:
N/A
Example:
play_age_signals_test_use_fake_manager(true);Sets the next fake test result for success.
Syntax:
play_age_signals_test_set_result(status, age_lower, age_upper, approval_date_ms, install_id)
| Argument | Type | Description |
|---|---|---|
| status | PlayAgeSignalsVerificationStatus | Age verification status. |
| age_lower | Real | Lower bound of the user's age range. -1 if unavailable. |
| age_upper | Real | Upper bound of the user's age range. -1 if unavailable. |
| approval_date_ms | Real | Timestamp (milliseconds since epoch) of the most recent parental approval. -1 if not available. |
| install_id | String | Unique identifier associated with the Play Store install. |
Returns:
N/A
Example:
play_age_signals_test_set_result(
PlayAgeSignalsVerificationStatus.Verified,
18,
120,
-1,
"test_install"
);Forces the next fake request to return an error.
Syntax:
play_age_signals_test_set_error(error_code)
| Argument | Type | Description |
|---|---|---|
| error_code | PlayAgeSignalsErrorCode |
Returns:
N/A
Example:
play_age_signals_test_set_error(
PlayAgeSignalsErrorCode.ApiNotAvailable
);These constants are referenced by the following functions:
These constants are referenced by the following structs:
| Member | Description |
|---|---|
None |
No status available. |
Verified |
User age has been verified. |
Supervised |
User account is supervised. |
SupervisedApprovalPending |
Parent approval required. |
SupervisedApprovalDenied |
Parent approval denied. |
Unknown |
Age status unknown. |
Declared |
Age was self-declared. |
These constants are referenced by the following functions:
These constants are referenced by the following structs:
| Member | Description |
|---|---|
NoError |
|
ApiNotAvailable |
API not supported on device. |
PlayStoreNotFound |
|
NetworkError |
|
PlayServicesNotFound |
|
CannotBindToService |
|
PlayStoreVersionOutdated |
|
PlayServicesVersionOutdated |
|
ClientTransientError |
|
AppNotOwned |
|
SdkVersionOutdated |
|
InternalError |
Passed as argument into the callback function that is passed into play_age_signals_check().
This struct is referenced by the following functions:
| Member | Type | Description |
|---|---|---|
| success | Boolean | Indicates if the request succeeded. |
| status | PlayAgeSignalsVerificationStatus | Age verification status. |
| age_lower | Real | Lower bound of the user's age range. -1 if unavailable. |
| age_upper | Real | Upper bound of the user's age range. -1 if unavailable. |
| approval_date_ms | Real | Timestamp (milliseconds since epoch) of the most recent parental approval. -1 if not available. |
| install_id | String | Unique identifier associated with the Play Store install. |
| error_code | PlayAgeSignalsErrorCode | Error code if the request failed. |
| error_message | String | Error description. |
GameMaker 2026