Copy private func startSdk () {
smartAuth ? . verifyPolicy (
personID : "userDocument" ,
policyId : "myPolicyId" ,
listener : setupListener ()
)
}
private func setupListener () -> CafVerifyPolicyListener {
return { result in
switch result {
case . onSuccess ( let response ) :
print ( "CafVerifyPolicyListener.onSuccess isAuthorized: \(response.isAuthorized) " )
print ( "CafVerifyPolicyListener.onSuccess attestation: \(response.attestation) " )
case . onPending ( let response ) :
print ( "CafVerifyPolicyListener.onPending isAuthorized: \(response.isAuthorized) " )
print ( "CafVerifyPolicyListener.onPending attestation: \(response.attestation) " )
case . onError ( let error ) :
print ( "CafVerifyPolicyListener.onError failure: \(error.localizedDescription) " )
case . onCanceled ( let error ) :
print ( "CafVerifyPolicyListener.onCanceled failure: \(error.localizedDescription) " )
case . onLoading ( let isLoading ) :
print ( "CafVerifyPolicyListener.onLoading isLoading: \(isLoading) " )
case . onLoaded ( let isLoaded ) :
print ( "CafVerifyPolicyListener.onLoaded isLoaded: \(isLoaded) " )
}
}
}