Plaid logo
Docs
ALL DOCS

Link

  • Overview
Libraries
  • Web
  • iOS
  • Android
  • React Native
  • Webview
Core Link flows
  • Link Token migration guide
  • OAuth guide
  • Account Select v2 migration guide
  • Update mode
  • Legacy public key integrations
Optimize Link
  • Customizing Link
  • Duplicate Items
  • Returning user experience
  • Link best practices
  • Modular Link (UK/EU only)
Errors and troubleshooting
  • Troubleshooting
  • Handling an invalid Link Token
  • Institution status in Link
Plaid logo
Docs
Plaid.com
Get API keys

2.x to 3.x Migration Guide

Reference for migrating the Link Android SDK from 2.x to 3.x

Android Link SDK versions prior to 3.5.0 (released August 2021) will no longer work with the Plaid API as of November 1, 2022. If you are using a version of the Android Link SDK earlier than 3.5.0, you must upgrade to version 3.5.0 or later before November 1, 2022.

Summary of changes

Plaid released the Android 3.0.0 SDK on September 20th, 2020. Upgrading to the new 3.x SDK allows you to take advantage of a unified mobile API and support all new features. This article provides a guide on how to upgrade a Plaid integration from the Android 2.x SDK to the 3.x SDK.

Remove initialize

1Plaid.initialize(this)

Is no longer part of the API and can be removed.

Opening Link

Creating Configuration
2.x.x3.x.x
com.plaid.link.configuration.LinkConfigurationcom.plaid.link.configuration.LinkPublicKeyConfiguration
LinkPublicKeyConfiguration.paymentTokenUse the LinkPublicKeyConfiguration.token field instead
com.plaid.link.configuration.AccountSubtypecom.plaid.link.result.LinkAccountSubtype
com.plaid.link.configuration.AccountTypecom.plaid.link.result.LinkAccountType
PlaidEnvironmentdeprecated
PlaidProductdeprecated
1val linkTokenConfiguration = linkTokenConfiguration {
2 token = "LINK_TOKEN_FROM_SERVER"
3 logLevel = if (BuildConfig.DEBUG) LinkLogLevel.VERBOSE else LinkLogLevel.ERROR
4}
PlaidHandler

Create a PlaidHandler - A PlaidHandler is a one-time use object used to open a Link session. It should be created as early as possible, since it must be completed before Link opens, and if delayed until just before Link opening it can have a perceptible impact on Link startup time.

1val plaidHandler: PlaidHandler = Plaid.create(application, linkTokenConfiguration)
Opening Link

We've removed the openLink functions on the Plaid object as well as the Kotlin extension functions for Activity and Fragment.

1Plaid.openLink(activity, configuration)
1this@MyActivity.openPlaidLink(configuration)
1this@MyFragment.openPlaidLink(configuration)

Instead you will need to call open on the PlaidHandler you created, passing in an Activity or Fragment.

1plaidHandler.open(activity)

Handling Results

LinkResultHandler

com.plaid.link.result.PlaidLinkResultHandler has been renamed to com.plaid.link.result.LinkResultHandler

LinkSuccessMetadata

LinkSuccessMetadata.rawMetadata renamed to LinkSuccessMetadata.metadata

LinkAccount

Fields renamed

  • accountId -> id
  • accountName -> name
  • accountNumber -> mask
  • accountSubtype -> subtype also type changed from String to com.plaid.link.result.LinkAccountSubtype
  • accountType has been removed, it is now a com.plaid.link.result.LinkAccountType object within LinkAccountSubtype
1private val linkResultHandler = LinkResultHandler(
2 // ...
3 onSuccess = { it: LinkSuccess ->
4 // Send public_token to your server, exchange for access_token
5 val publicToken = it.publicToken
6 val metadata = it.metadata
7 metadata.accounts.forEach { account ->
8 val accountId = account.id
9 val accountName = account.name
10 val accountMask = account.mask
11 val accountSubType = account.subtype
12 }
13 val institutionId = metadata.institution?.id
14 val institutionName = metadata.institution?.name
15 }
16)
LinkError
  • errorCode has been typed as an ErrorCode object
  • errorType has been removed from LinkError and added to the ErrorCode object
  • errorJson field has been added with raw JSON from server
LinkExitMetadata
  • institutionId and institutionName moved into institution which is a LinkInstitution and renamed to id and name object
  • exitStatus removed
  • metadataJson field has been added with raw JSON from server
1private val linkResultHandler = LinkResultHandler(
2 // ...
3 onExit = {
4 val error = it.error
5 error?.let { error ->
6 val errorCode = error.errorCode
7 val errorType = error.errorCode.errorType
8 val errorMessage = error.errorMessage
9 val displayMessage = error.displayMessage
10 }
11 val metadata = it.metadata
12 val institutionId = metadata.institution?.id
13 val institutionName = metadata.institution?.name
14 val linkSessionId = metadata.linkSessionId;
15 val requestId = metadata.requestId;
16 }
17)

Handling Events

LinkEventMetadata metadataJson added with raw JSON from server

Exceptions

All exceptions moved from com.plaid.link.internal.exceptions to com.plaid.link.exceptions

Was this helpful?
Developer community
Github logo
StackOverflow logo
Twitter logo