Get Age Signals

With the global trend to protect minors in digital environments, recent legislative developments have begun across the United States as well as in various countries worldwide. These laws impose new responsibilities on app stores and require developers distributing apps through app stores in these regions to comply with specific obligations.

The Get Age Signals API helps you to comply with these obligations by providing the users' age range and parental consent status. You can use this information, in compliance with the latest legislative requirements, to verify that a user can purchase an app, download an app, make in-app purchases, or make a purchase using an app.

In order to use the Get Age Signals API, do the following:

  1. Add permissions to your manifest file.
  2. Check the Galaxy Store version to verify that it supports the Galaxy Store Provider API.
  3. Verify user information and their ability to purchase/download your app and make purchases.

Add permissions

To add permissions for the Get Age Signals API and the ability to query the specified content provider, edit your app's AndroidManifest.xml file and add the following:

<uses-permission android:name="com.sec.android.app.samsungapps.accesspermission.ASAA_PROVIDER.READ" />
<queries>
    <provider android:authorities="com.sec.android.app.samsungapps.provider.ASAA" />
</queries>

Check the Galaxy Store version

In order to support the Get Age Signals API, the version of Galaxy Store on the user's device must be 4.6.03.1 or higher.

The following example demonstrates how you can check the Galaxy Store version on the user's device.

boolean checkProviderAvailable(){
    ApplicationInfo appInfo = null;
    try {
        appInfo = getPackageManager().getApplicationInfo("com.sec.android.app.samsungapps", PackageManager.GET_META_DATA);
    } catch (PackageManager.NameNotFoundException e) {
    }

    float version = 0f;
    if (appInfo != null) {
        Bundle bundle = appInfo.metaData;
        if (bundle != null) {
            version = bundle.getFloat("com.sec.android.app.samsungapps.AccountabilityActProvider.version", 0f);
        }
    }
    boolean isSupported = version >= 1.0f;
    return isSupported;
}

Verify user information

The getAgeSignalResult method gets the user's age range and status and returns the information in a bundle. Use this information to verify the user can purchase/download your app and make purchases.

  • Method name: getAgeSignalResult
  • Provider version: 1.0
  • Java method signature: public final Bundle call(@NonNull Uri uri, @NonNull String method, @Nullable String arg, @Nullable Bundle extras)
  • URI: content://com.sec.android.app.samsungapps.provider.ASAA/settings
  • Extras: Null
  • Result type: Bundle
Bundle Key

Type

Description and Value

result_code

int

The result of the method call.

0: Success, the call succeeded.
1: Failure, the call failed.

result_message

string

If the result_code is 1, the reason the call failed.

It is not a supported method: The method name is not correct or the function is disabled by the server.
The device is not registered SA: The device does not have a registered Samsung account.

userStatus

string

The type of user.

VERIFIED: The user is 18 years of age or older.
SUPERVISED: The user is minor and has a supervised Samsung account that is managed by a parent who sets their age.
SUPERVISED_APPROVAL_DENIED: The user is a minor and has a supervised Samsung account that is managed by a parent who sets their age and the parent has denied the user the ability to install or launch the app.
UNKNOWN: There could be one or more reasons for this value:
1) The user has not agreed to the Galaxy Store's terms and conditions.
2) The app is not installed from Galaxy Store.
3) The user is a minor who is not a member of a Samsung account family group.
4) The user is a minor but the Samsung parental supervision controls are not applied.

ageLower

string

The (inclusive) lower bound of the age range of a supervised user. For example, if this is set to 5, the user is at least 5 years old.

0 - 18: The lower bound is from 0 to 18 years.
Null: The user has not agreed to the Galaxy Store's terms and conditions.

ageUpper

string

The (inclusive) upper bound of the age range of a supervised user. For example, if this is set to 12, the user is at most 12 years old.

0 - 18: The upper bound is from 0 to 18 years.
Null: The user has not agreed to the Galaxy Store's terms and conditions.

Example

final String AUTHORITY = " com.sec.android.app.samsungapps.provider.ASAA";
final String QUERY_SETTINGS = "settings";
final String URI_SETTINGS = "content://"+AUTHORITY+"/"+QUERY_SETTINGS;
final String METHOD_GET_AGE_SIGNAL_RESULT = "getAgeSignalResult";
final String KEY_RESULT_USER_STATUS = "userStatus";
final String KEY_RESULT_AGE_LOWER = "ageLower";
final String KEY_RESULT_AGE_UPPER = "ageUpper";

String getAgeSignalResult() {

    if (!checkProviderAvailable()){
        return null;
    }

    ContentResolver contentResolver = getContentResolver();
    Bundle resultBundle = null;
    try {
        resultBundle = contentResolver.call(Uri.parse(URI_SETTINGS), METHOD_GET_USER_AGE_RANGE, null, null);
    } catch (Exception e) {
        // Need to check e.getMessage()
    }

    if (resultBundle != null) {
        int resultCode = resultBundle.getInt("result_code", 1);
        if (resultCode == 0) { // success
             String userStatus = resultBundle.getString(KEY_RESULT_USER_STATUS, "");
             String ageLower = resultBundle.getString(KEY_RESULT_AGE_LOWER, "");
             String ageUpper = resultBundle.getString(KEY_RESULT_AGE_UPPER, "");

        } else { // failure
            String resultMessage = resultBundle.getString("result_message", "");
            return resultMessage;
        }
    }
    return null;

}

How user information is retrieved

  1. Your app requests user information using the Get Age Signals API.
  2. The response, when successful, includes the user's age range and status.

Additional Terms and Conditions

In addition to complying with Seller Portal's Terms and Conditions and Data Terms, you must also comply with these additional terms and conditions when using the Get Age Signals API:

  1. The Get Age Signals API can only be used by apps that are registered and updated in Galaxy Store.
  2. The information provided by the Get Age Signals API can only be used by the requesting app and can only be used for compliance with the latest legislative requirements. This information cannot be used for any other purposes (including, but not limited to, demographic analysis, advertising or other promotional activities, market research or other marketing activities, or performance tracking).
  3. Unauthorized and unlawful use of the Get Age Signals API and the provided information is strictly prohibited and may result in the loss of access to the Get Age Signals API and your app(s) being suspended or removed from Galaxy Store.