-
public final class Inquiry
Start a Persona Inquiry flow and parse the response from your Activity.
// pick any number and then use it later to retrieve the response val VERIFY_REQUEST_CODE = 43 // Get the template ID from the Dashboard // https://withpersona.com/dashboard/development val TEMPLATE_ID = "tmpl_JAZjHuAT738Q63BdgCuEJQre" // ... Inquiry.fromTemplate(TEMPLATE_ID) .environment(Environment.SANDBOX) .build() .start(this, VERIFY_REQUEST_CODE)
// overwriting the Activity#onActivityResult override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == VERIFY_REQUEST_CODE) { when(val result = Inquiry.onActivityResult(data)) { is Inquiry.Response.Success -> { // ... } is Inquiry.Response.Failure -> { // ... } Inquiry.Response.Cancel -> { // ... } is Inquiry.Response.Error -> { // ... } } } }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Inquiry.TemplateBuilder
Get a this builder by calling Inquiry.fromTemplate.
public final class
Inquiry.InquiryBuilder
Get a this builder by calling Inquiry.fromInquiry.
public class
Inquiry.Response
Inquiry flow response parent class. The response will either be Success, Cancel, Failure, or Error.
public class
Inquiry.Companion
-
Method Summary
-
-
Method Detail
-
start
@MainThread() final Unit start(Activity activity, Integer requestCode)
Launch the Persona Inquiry.
- Parameters:
activity
- current Activity that will get the responserequestCode
- arbitrary number that will be returned to you in the response
-
-
-
-