Copy private fun startSdk () {
smartAuth. verifyPolicy (
"userDocument" ,
"myPolicyId" ,
setupListener ()
)
}
private fun setupListener () = object : CafVerifyPolicyListener {
override fun onSuccess (
isAuthorized: Boolean ,
attemptId: String ?,
attestation: String ?
) {
println ( "CafVerifyPolicyListener.onSuccess isAuthorized: $isAuthorized" )
println ( "CafVerifyPolicyListener.onSuccess attemptId: $attemptId" )
println ( "CafVerifyPolicyListener.onSuccess attestation: $attestation" )
}
override fun onPending (isAuthorized: Boolean , attestation: String ) {
println ( "CafVerifyPolicyListener.onPending isAuthorized: $isAuthorized" )
println ( "CafVerifyPolicyListener.onPending attestation: $attestation" )
}
override fun onError (failure: CafFailure ) {
println ( "CafVerifyPolicyListener.onError failure: ${ failure.message } " )
}
override fun onCancel () {
println ( "CafVerifyPolicyListener.onCancel" )
}
override fun onLoading () {
println ( "CafVerifyPolicyListener.onLoading" )
}
override fun onLoaded () {
println ( "CafVerifyPolicyListener.onLoaded" )
}
}