Age Verification Module
Method 1: Check Status
Privo.ageVerification.getStatus(userIdentifier, completionHandler)
The method allows checking the existing Age Verification status.
Age Verification Status entry parameters:
userIdentifier - optional String field, external user identifier
completionHandler - closure which used to handle the result of an asynchronous operation and takes as input argument AgeVerificationEvent instance.
struct AgeVerificationEvent {
let status: AgeVerificationStatus
let profile: AgeVerificationProfile?
}
struct AgeVerificationProfile {
let userIdentifier: String?
let firstName: String?
let email: String?
let birthDateYYYYMMDD: String? // “yyyy-MM-dd” format
let phoneNumber: String?
}
status - enum with values: “Undefined” , “Pending” , “Confirmed” , “Declined” , “Canceled”.
profile - child profile verified by PRIVO:
userIdentifier - optional field, external user identifier
birthDateYYYYMMDD - optional field, external user birth date in "yyyy-MM-dd" format
email - optional field, child user email address
firstName - optional field, child user first name
phoneNumber - optional field, child user phone number in the full international format (E.164, e.g.
“+17024181234”)
Please check the Age Verification Status Description here
Method 2: Run
Privo.ageVerification.run(profile, completionHandler)
struct AgeVerificationProfile {
let userIdentifier: String?
let firstName: String?
let email: String?
let birthDateYYYYMMDD: String?
let phoneNumber: String?
}
The method runs the Age Verification check and returns the following statuses, depending on the user’s age and set by a
partner configuration parameters: “Undefined” , “Pending” , “Confirmed” , “Declined” , “Canceled”.
AgeVerificationProfile entry (profile) parameters:
userIdentifier - optional field, external user identifier
birthDateYYYYMMDD - optional field, external user birth date in "yyyy-MM-dd" format
firstName - optional field, child user first name
email - optional field, child user email address
birthDateYYYYMMDD - optional field, child user birth date in “yyyy-MM-dd” format
phoneNumber - optional field, child user phone number in the full international format (E.164, e.g.
“+17024181234”)
completionHandler receives AgeVerificationEvent? instance, where nil indicates a failure has occurred.
struct AgeVerificationEvent {
let status: AgeVerificationStatus
let profile: AgeVerificationProfile?
}
struct AgeVerificationProfile {
let userIdentifier: String?
let firstName: String?
let email: String?
let birthDateYYYYMMDD: String? // “yyyy-MM-dd” format
let phoneNumber: String?
}
status - enum with values: “Undefined” , “Pending” , “Confirmed” , “Declined” , “Canceled”.
profile - child profile verified by PRIVO:
userIdentifier - optional field, external user identifier
birthDateYYYYMMDD - optional field, external user birth date in "yyyy-MM-dd" format
email - optional field, child user email address
firstName - optional field, child user first name
phoneNumber - optional field, child user phone number in the full international format (E.164, e.g.
“+17024181234”)
Please check the Age Verification Status Description here
Age Verification SDK example
Privo.ageVerification.getStatus(userIdentifier) { response in
status = response.status
}
// ...
let profile = AgeVerificationProfile(
userIdentifier: userIdentifier,
firstName: firstName,
email: email,
birthDateYYYYMMDD: getBirhDate(),
phoneNumber: phoneNumber
)
Privo.ageVerification.run(profile) { response in
status = response.status
}