Package 

Class Inquiry

  • All Implemented Interfaces:

    
    public final class Inquiry
    
                        

    Start a Persona Inquiry flow and parse the response from your Activity.

    val getInquiryResult =
      registerForActivityResult(Inquiry.Contract()) { result ->
        when (result) {
          is InquiryResponse.Complete -> {
            // ... completed flow
          }
          is InquiryResponse.Cancel -> {
            // ... abandoned flow
          }
          is InquiryResponse.Error -> {
            // ... something went wrong
          }
        }
      }
    // Get the template ID from the Dashboard
    // https://withpersona.com/dashboard/integration
    val TEMPLATE_ID = "YOUR_TEMPLATE_ID"
    // ...
    
    val inquiry = Inquiry.fromTemplate(TEMPLATE_ID)
      .environment(Environment.SANDBOX)
      .build()
    // ...
    
    getInquiryResult.launch(inquiry)
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class Inquiry.Contract

      Contract to initiate and get the result from an Inquiry flow by using registerForActivityResult.

      val getInquiryResult = registerForActivityResult(Inquiry.Contract()) { result ->
        when(result) {
          is InquiryResponse.Complete -> {}
          is InquiryResponse.Cancel -> {}
          is InquiryResponse.Error -> {}
        }
      }
      public class Inquiry.Companion
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Unit start(Activity activity, Integer requestCode) Launch the Persona Inquiry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • start

        @MainThread()@Deprecated(message = "Use registerForActivityResult with the Inquiry.Contract instead.") 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