Package 

Class Inquiry


  • 
    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 -> {
            // ...
          }
        }
      }
    }
    • Method Detail

      • start

        @MainThread() final Unit start(Activity activity, Integer requestCode)

        Launch the Persona Inquiry.

        Parameters:
        activity - current Activity that will get the response
        requestCode - arbitrary number that will be returned to you in the response