Gamebase SDK for Unity 2.76.0 Toast Gamebase Platform

Loading...
Searching...
No Matches

## ◆ GetAgeSignal()

static void GetAgeSignal | ( | GamebaseCallback.GamebaseDelegate< GamebaseResponse.Util.AgeSignalResult > | callback | ) |
| static

Gets the AgeSignal on the device.

(Android Only)

Since
  Added 2.67.0.

Returns
  The AgeSignal currently on the device.

Example Usage :

public void GetAgeSignal()
{
#if UNITY_ANDROID
Gamebase.Util.GetAgeSignal((data, error) => // Android only
{
if (Gamebase.IsSuccess(error) == true)
{
if(data.userStatus.HasValue == false)
{
// Not legally applicable (null)
}
else
{
GamebaseAgeSignalsVerificationStatus userStatus = (GamebaseAgeSignalsVerificationStatus)data.userStatus.Value;
switch (userStatus)
{
case GamebaseAgeSignalsVerificationStatus.VERIFIED:
// Age 18 or older
break;
case GamebaseAgeSignalsVerificationStatus.SUPERVISED:
// Under supervision
// Determine age range
//data.ageLower.Value;;
//data.ageUpper.Value;;
break;
case GamebaseAgeSignalsVerificationStatus.SUPERVISED_APPROVAL_PENDING:
// Under supervision
// Determine age range
// data.ageLower.Value;;
// data.ageUpper.Value;;
// Date of the most recently approved significant change
// data.mostRecentApprovalDate;
// Installation ID ? used to notify about app approval revocation
// data.installId;
break;
case GamebaseAgeSignalsVerificationStatus.SUPERVISED_APPROVAL_DENIED:
// Parent or guardian has denied one or more significant changes
// Determine age range
// data.ageLower.Value;;
// data.ageUpper.Value;;
// Date of the most recently approved significant change
// data.mostRecentApprovalDate;
// Installation ID ? used to notify about app approval revocation
// data.installId;
break;
case GamebaseAgeSignalsVerificationStatus.UNKNOWN:
// The user is not verified or supervised in the relevant jurisdiction or region.
// To receive age signals from Google Play, prompt the user to visit the Play Store and resolve their status.
break;
}
}
}
else
{
// Failed to get AgeSignal.
}
});
#endif
}
Toast.Gamebase.Gamebase.Util.GetAgeSignal
static void GetAgeSignal(GamebaseCallback.GamebaseDelegate< GamebaseResponse.Util.AgeSignalResult > callback)
Gets the AgeSignal on the device.
Definition Gamebase.cs:3151
Toast.Gamebase.Gamebase.Util
The Util class provides convenient and useful methods.
Definition Gamebase.cs:2931
Toast.Gamebase.Gamebase.IsSuccess
static bool IsSuccess(GamebaseError error)
Return true if the GamebaseException object is null or the error code is zero.
Definition Gamebase.cs:57
Toast.Gamebase.Gamebase
The Gamebase class is core of Gamebase service.
Definition Gamebase.cs:11