Detailed instructions on how to integrate with Plaid Link for Android can be found in our main documentation at [plaid.com/docs/link/android][link-android-docs].
This repository contains a sample application that demonstrates integration and use of Plaid Link for Android. There are activities that show how to open link from Kotlin or Java.
Android Studio 3.0 or greater A Plaid public_key; available from the Plaid Dashboard
- Clone the repository
git clone https://github.com/plaid/plaid-link-android.git
- Open the repository with Android Studio (or IntelliJ)
- Add your plaid public key from the Plaid Dashboard to the donottranslate.xml file
<string name="plaid_public_key">TODO Add your public_key here</string>
- Follow the instrutions to register the
myapp://plaid-redirect
redirect Uri on the plaid dashboard. - Build and run from Android Studio (green arrow or Run -> Run App)
Or run from the command line
./gradlew installDebug
adb shell am start -n "com.plaid.linksample/com.plaid.linksample.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
To use a different redirect Uri, update the Android manifest:
<data
android:host="plaid-redirect"
android:scheme="myapp" />
the LinkConfiguration
that is passed to the Plaid.openLink()
method in the MainActivity
and the MainJavaActivity
:
Plaid.openLink(
...
linkConfiguration = LinkConfiguration(
...
webviewRedirectUri = "myapp://plaid-redirect"
)
...
)
and register the Uri in the plaid dashboard.
The repository contains a java and kotlin application class and a java and kotlin activity. From the kotlin activity you can open the java activity using the menu in the action bar and similarly from the java activity you can open the kotlin activity from the same menu. If you want to test the java appplication class instead of the kotlin application class just change the name in the application tag in the Android manifest to name=".LinkSampleJavaApplication"
.
When running the app, the floating action button will start the Link flow and when the flow completes (with a success, cancellation, error, or crash) you will see the results in the main activity.