Skip to main content
This page outlines the steps to load the Meld bank linking widget inside your Android mobile app using a WebView, and to support App to App authentication with banks that have implemented it.

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/start to obtain a widget URL.

Project Setup

App Links are the Android equivalent of iOS’s universal links.
  • Here is an example of what AndroidManifest.xml will look like:
XML
  • We need to pass the redirectUrl in Meld’s /bank-linking/connect/start endpoint.
  • 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.
  • 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
The above example is specific to the Chase app. If you wish to enable app to app authentication with additional apps, include the respective package entries for each additional app in the <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

  1. To handle the MX service provider appropriately, incorporate the following code snippet within the shouldOverrideUrlLoading function:
Kotlin

Plaid and Finicity

  1. 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

  1. 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.
  2. 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