For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help CenterOpenAPI SpecStatus
OverviewInquiriesTransactionsAPI ReferenceChangelog
OverviewInquiriesTransactionsAPI ReferenceChangelog
  • Overview
    • Inquiries Overview
    • Inquiry Model Lifecycle
    • Inquiry Templates
  • Managing inquiries
    • Creating Inquiries
    • Resuming Inquiries
    • Accessing Inquiry status and data
  • Hosted Flow integration
  • Embedded Flow integration
  • Mobile SDK integration
    • Overview
      • Android Integration Guide
      • Android Inline Inquiries Guide
      • Android SDK Changelog
      • Migrate Android Theming from Client to Server
      • Migrate from Android SDK v1 to v2
      • Google Play Data Privacy
      • Android Licenses
    • Webview
  • Troubleshooting
    • Troubleshooting Steps
    • Troubleshooting Common Issues
LogoLogo
Help CenterOpenAPI SpecStatus
On this page
  • v1 is deprecated
  • Am I using Dynamic Flow Templates?
  • I am an existing customer using Android SDK v1. Do I need to migrate?
  • What do I need to do to migrate to Android SDK v2 API?
  • Updated namespace
  • Updating the SDKv2 namespace on Android
  • Update dependency
  • Updated callbacks
  • Before
  • After
  • Supporting both v1 and v2 in parallel
  • Inquiry#start and Inquiry.onActivityResult are deprecated
  • Update theming
  • Full list of breaking changes
  • What’s new in Android SDK v2 API?
Mobile SDK integrationAndroid

Migrate from Android SDK v1 to v2

Was this page helpful?
Previous

Google Play Privacy

Detailed information on completing the Google Play Store questions when submitting your app for release or update.
Next
Built with

v1 is deprecated

As of December 31, 2022, the v1 SDK and Legacy Templates are considered deprecated.

Android SDK v2 brings support for Dynamic Flow Templates, which represent the next generation of Persona’s inquiry flow. Dynamic Flow Templates allow for greater flexibility in data collection by allowing custom UIs and collection fields.

Dynamic Flow Templates support versioning and fully custom, component-based views. If you are an existing customer and are interested in using Dynamic Flow Templates, please contact us or talk to your CSM.

Am I using Dynamic Flow Templates?

If your template ID starts with tmpl_, then you are using the old Template and should use the Android SDK v1.

If your template ID starts with itmpl_, then you are using the new Dynamic Flow Template and must use Android SDK v2.

I am an existing customer using Android SDK v1. Do I need to migrate?

You must use Android SDK v2 if you are using Dynamic Flow Templates. Inquiries created via Dynamic Flow Templates will not work properly with Android SDK v1.

Existing users who are not using Dynamic Flow Templates will not need to migrate to Android SDK v2, and Android SDK v1 will continue working for the immediate future. However, we encourage using the latest version whenever possible to take advantage of improvements and bug fixes.

If you have a hard reliance on removed features, but want/need to use Dynamic Flow Templates, please contact us or talk to your CSM for a migration path.

What do I need to do to migrate to Android SDK v2 API?

The following table lists breaking changes in the 2.x version of our SDK.

Updated namespace

The Android SDK v2 now has a new namespace. You can safely load v1 and v2 concurrently if you require a phased rollout to upgrade to Dynamic Flow.

Updating the SDKv2 namespace on Android

The package com.withpersona.sdk has been renamed to com.withpersona.sdk2 so the easiest way to migrate to the new namespace is to do a project wide find and replace, changing all occurrences of com.withpersona.sdk with com.withpersona.sdk2.

Update dependency

diff
1dependencies {
2 // ...
3- implementation 'com.withpersona.sdk:inquiry:1.a.b'
4+ implementation 'com.withpersona.sdk2:inquiry:2.x.y'
5 // ...
6}

Inquiry SDK latest

Updated callbacks

Before

kotlin
1override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
2 super.onActivityResult(requestCode, resultCode, data)
3 if (requestCode == INQUIRY_REQUEST_CODE) {
4 when (val response = Inquiry.onActivityResult(data)) {
5 is Inquiry.Response.Success -> {
6 // response.inquiryId
7 // response.attributes
8 // response.relationships.verifications
9 }
10 is Inquiry.Response.Failure -> {
11 // response.inquiryId
12 // response.attributes
13 // response.relationships.verifications
14 }
15 is Inquiry.Response.Cancel -> {
16 }
17 is Inquiry.Response.Error -> {
18 // response.debugMessage
19 }
20 }
21 }
22 // ...
23}

After

kotlin
1override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
2 super.onActivityResult(requestCode, resultCode, data)
3 if (requestCode == INQUIRY_REQUEST_CODE) {
4 when (val response = Inquiry.onActivityResult(data)) {
5 is InquiryResponse.Complete -> {
6 // response.status ('failed', 'completed')
7 // response.inquiryId
8 // response.fields
9 }
10 is InquiryResponse.Cancel -> {
11 // response.inquiryId
12 // response.sessionToken
13 }
14 is InquiryResponse.Error -> {
15 // response.debugMessage
16 }
17 }
18 }
19 // ...
20}

Supporting both v1 and v2 in parallel

Make sure the v1 instance is at least Android SDK v1.1.18. Inquiry SDK latest

Use the Persona.Inquiry2.Theme and Persona.Inquiry1.Theme and their corresponding fields to support the v1 themes (AppCompat-based) and v2 themes (Material-based).

Inquiry#start and Inquiry.onActivityResult are deprecated

The recommended way is to use the Activity Results API’s registerForActivityResult method with the Inquiry.Contract() object.

Update theming

Persona’s styles are now based on Material light as opposed to AppCompat’s day-night theme.

diff
1<resources>
2 <!--...-->
3 <style name="ExampleCustomTheme" parent="@style/Persona.Inquiry.Theme">
4 <item name="colorPrimary">#2196f3</item>
5- <item name="colorAccent">#6ec6ff</item>
6- <item name="colorPrimaryDark">#0069c0</item>
7+ <item name="colorSecondary">#6ec6ff</item>
8+ <item name="colorPrimaryVariant">#0069c0</item>
9 </style>
10</resources>

Full list of breaking changes

ChangeReplacement
Inquiry.Response.Success and Inquiry.Response.Failure removedInquiryResponse.Complete returned for both passes and fails with a new status argument; check for failure with status == 'failed'.
Inquiry.Response.Cancel and Inquiry.Response.Error renamedInquiryResponse.Cancel and InquiryResponse.Error
Inquiry.InquiryBuilder#accessToken renamedInquiryBuilder#sessionToken
Inquiry.InquiryBuilder#note removedBoth Dynamic Flow Templates and Templates support custom fields. Contact us to configure custom fields as a replacement.
Fields.Builder#emailAddress, Fields.Builder#phoneNumber, Fields.Builder#name, Fields.Builder#address, and AttributesFields.Builder#field with “emailAddress”, “phoneNumber”, “nameFirst”, “nameMiddle”, “nameLast”, “addressStreet1”, “addressStreet2”, “addressCity”, and other names passed in as strings (when available).
Relationships and Verification removedThese response objects were used to support use cases Dynamic Flow supports more robustly. Please contact us about your use case if you were using the fields.
Inquiry#start deprecatedregisterForActivityResult(Inquiry.Contract()) is the recommended way to go

What’s new in Android SDK v2 API?

ChangePurpose
Inquiry#fromTemplateVersion builderAllows locking inquiry creation to a specific template version. Only Dynamic Flow Templates have versions.
Cancel now returns inquiryId and sessionTokenAllows for resuming the Inquiry flow without needing to make a server call.
Complete returns a map of field names to InquiryFieldEnable custom data returned to the client. Contact us for your use case.