Before you begin
- An Android project (Kotlin) where you can integrate a
WebView. - A domain you control for Android App Links.
- A Meld API key and the ability to call
/bank-linking/connect/startto obtain a widget URL.
Project Setup
Step 1: App Links Setup
App Links are the Android equivalent of iOS’s universal links.App Links Step 1: Setup Android app links following this guide.
- Here is an example of what AndroidManifest.xml will look like:
XML
App Links Step 2: Redirect URL
- We need to pass the
redirectUrlin Meld’s/bank-linking/connect/startendpoint. - Ensure that the redirectUrl parameter is an HTTP URL and not a deep link. It should specifically be formatted as an Android App Link. For detailed guidance on creating App Links, refer to the instructions provided in this guide.
App Links Step 3: Opening the Widget URL in a Webview
- Add the following settings to the webview to give the proper permissions:
Kotlin
- Here’s the definition of the CustomWebViewClient class:
Kotlin
Enable Visibility
To enable app to app authentication, you may need to declare specific apps as visible to your app by adding queries in your AndroidManifest.xml file. For example, to enable visibility for the Chase app, include the following:XML
<queries> section.
Important Considerations for QUERY_ALL_PACKAGES Permission
From Android 11 (API level 30), the QUERY_ALL_PACKAGES permission is restricted to apps that target API level 30 or later on devices running Android 11 or newer. To use this permission, your app must fulfill specific criteria outlined by the Google Play policy. This includes having a core purpose that requires visibility of all installed apps on the device and providing a sufficient justification as to why alternative, less intrusive methods of app visibility would not enable the app’s policy-compliant, user-facing functionality. In some cases, Android may restrict visibility of certain apps to your app. If your app needs to access a comprehensive list of all installed apps on the device, include the QUERY_ALL_PACKAGES permission in the Android manifest. Be aware that if you intend to publish your app on Google Play, the usage of this permission is subject to Google Play’s approval process.Provider Specific Code
Depending on which provider(s) your app uses, you will have to configure some provider specific code in order to make app to app authentication works. This section details what that code is.MX
- To handle the MX service provider appropriately, incorporate the following code snippet within the shouldOverrideUrlLoading function:
Kotlin
Plaid and Finicity
- For Plaid and Finicity, integrate the following code into the shouldOverrideUrlLoading function. This addition functions as an “else” case subsequent to the “if” condition handling the MX provider:
Kotlin
Kotlin
Listening to Front End Events
- Currently these events work for only Plaid & Finicity, not MX. After a successful OAuth process Meld’s widget will emit a handful of events which will need to be appropriately handled when control returns back to the app of origin.
- You can listen to couple of pre-defined events which can be used to detect if the authentication process is completed, canceled, or if there was an error.
Kotlin