Age Gate Module

Method 1: Check Status

Privo.ageGate.getStatus(userIdentifier)

The method allows checking the existing Age Gate status.

Age Gate Status entry parameters:

userIdentifier - optional String field, external user identifier

Age Gate Service response:

struct AgeEvent {
  status: AgeCheckStatus
  userIdentifier: String?
  agId: String?
  ageRange: AgeRange?
}

struct AgeRange: Decodable, Encodable, Hashable {
  start: Int
  end: Int
  jurisdiction: String?
}

status - enum with values: “Undefined”, “Blocked”, “Allowed”, “Сanceled”, “Pending”, “ConsentRequired” “ConsentApproved”, “ConsentDenied”, “AgeVerificationRequired”, “AgeVerified”, “AgeBlocked”, “IdentityVerificationRequired”, “IdentityVerified”.

userIdentifier - String field, external user identifier

agId - String field, age gate identifier

Please check the Age Gate Status Description here

Method 2: Run

Privo.ageGate.run(data)

struct CheckAgeData {
  userIdentifier: String?
  birthDateYYYYMMDD: String?
  birthDateYYYYMM: String?
  birthDateYYYY: String?
  countryCode: String?
}

The method runs the Age Gate check: if the birth date is passed by a partner or filled in by a user, the method will return the status "Undefined", "Blocked", "Allowed", "Сanceled", "Pending", "ConsentRequired" "ConsentApproved", " ConsentDenied, "AgeVerificationRequired", "AgeVerified", "AgeBlocked", "IdentityVerificationRequired", " IdentityVerified" depending on the user’s age and set by a partner configuration parameters.
If the birth date is not passed, a user will be navigated to the corresponding entry window and forced to fill in the birthday field.

CheckAgeData entry parameters:

userIdentifier - optional field, external user identifier

birthDateYYYYMMDD - optional field, external user birth date in "yyyy-MM-dd" format
birthDateYYYYMM - optional field, external user birth date in "yyyy-MM" format
birthDateYYYY - optional field, external user birth date in "yyyy" format

countryCode - optional field, two-letter country code (ISO 3166-1 alpha-2 Wiki).

Response:

struct AgeEvent {
  status: AgeGateStatus
  userIdentifier: String?
  agId: String?
  ageRange: AgeRange?
}

struct AgeRange: Decodable, Encodable, Hashable {
  start: Int
  end: Int
  jurisdiction: String?
}

status - enum, "Undefined", "Blocked", "Allowed", "Сanceled", "Pending", "ConsentRequired", "ConsentApproved", " ConsentDenied, "AgeVerificationRequired", "AgeVerified", "AgeBlocked", "IdentityVerificationRequired", " IdentityVerified"

userIdentifier - optional field, external user identifier

agId - optional field, age gate identifier

Please check the Age Gate Status Description here

Method 3: Age Recheck

ageGate.recheck(data)

struct CheckAgeData {
  userIdentifier: String?
  birthDateYYYYMMDD: String?
  birthDateYYYYMM: String?
  birthDateYYYY: String?
  countryCode: String?
}

The method allows rechecking data if the birth date provided by a user was updated.

Age Gate Recheck entry parameters:

userIdentifier - optional field, external user identifier

birthDateYYYYMMDD - optional field, external user birth date in "yyyy-MM-dd" format

countryCode - optional field, two-letter country code (ISO 3166-1 alpha-2 Wiki).

Response:

struct AgeEvent {
  status: AgeGateStatus
  userIdentifier: String?
  agId: String?
  ageRange: AgeRange?
}

struct AgeRange: Decodable, Encodable, Hashable {
  start: Int
  end: Int
  jurisdiction: String?
}

status - enum, "Undefined", "Blocked", "Allowed","Сanceled", "Pending", "ConsentRequired", "ConsentApproved", " ConsentDenied, "AgeVerificationRequired", "AgeVerified", "AgeBlocked", "IdentityVerificationRequired", " IdentityVerified"

userIdentifier - optional field, external user identifier

agId - optional field, age gate identifier

Method 4: Age Gate Show Identifier Modal

Privo.ageGate.showIdentifierModal(userIdentifier)

The method will show a modal dialog with user age gate identifier (can be used to contact customer support)

Age Gate Show Identifier Modal parameters:

userIdentifier - optional string field, external user identifier

Method 5: Hide Age Gate Widget

ageGate.hide()

The method allows a partner to hide the Age Gate widget.

Age Gate Flow Diagrams

Simple Age Gate Flow Diagram
Simple Age Gate Flow Diagram

Age Gate Flow Diagram (with Age Recheck)
Simple Age Gate Flow Diagram

Age Gate SDK example:

    Privo.ageGate.getStatus(userIdentifier) { s in
        event = s
      }

      // ...

      let data = CheckAgeData(
        userIdentifier: userIdentifier,
        birthDateYYYYMMDD: birthDate,
        countryCode: country
      )
      Privo.ageGate.run(data) { s in
        event = s
      }

      // ...

      Privo.ageGate.recheck(data) { s in
        event = s
      }

Sample Webhook Response:

{
  "id": "861dc238-...-c1dfe",
  "status": "Allowed",
  "extUserId": "9ede0f0-...a78",
  //optional
  "countryCode": "US"
  //optional
}