Integrating FastLink 4 for React Native

FastLink can be integrated into your React Native using the React Native community webview >= 5.0.1 instead of Webview.

Integration Steps

Step 1: Generate an Access Token

FastLink uses the client credentials authentication mechanism. You need to pass a valid accessToken to authenticate your invocation of the FastLink application. Generate the access token by following the instructions provided in the Getting Started with Client Credentials page.

Step 2: Import the WebView Component

Usage of the WebView component from React Native module is deprecated, instead use react-native-community/react-native-webview.

import { WebView } from 'react-native-webview'

Step 3: Create Post Data

After importing the WebView component, create post data.

let postData =
    'accessToken=Bearer {{ACCESS_TOKEN}}&extraParams=' +

Step 4: Load the Request Object in the WebView Instance

Once the request object is ready, load it in the WebView instance. This will render the FastLink inside WebView.

    <View style={{ flex: 1 }}>
                uri: 'FASTLINK_URL',
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                body: postData,
                method: 'POST'
            style={{ flex: 1 }}
            onMessage={(event) => {
                //Handle Events from the FastLink

Passing Additional Params to FastLink

While creating post data, additional params like deep-linking flow attributes, callback details, etc., can be passed as query parameters along with the mandatory configName parameter. Following is a sample code snippet for the add deep-link flow.

let postData =
    'accessToken=Bearer {{ACCESS_TOKEN}}&extraParams=' +

For more details, refer to the Additional Params section in FastLink 4 Advanced Integration.

Handling Open Banking Sites

The intentUrl attribute is used to get the control back to the native app from an external application. Example, native browser.

Passing intentUrl as part of extraParams

let postData =
    'accessToken=Bearer {{ACCESS_TOKEN}}&extraParams=' +

When the user selects an Open Banking site, FastLink will send a post message with the site's OAuth URL which needs to be opened in a native browser.


    "type": "OPEN_EXTERNAL_URL",
    "data": {
        "url": "<OAUTH URL>"

Once the user logs in, authorize consent, and completes the flow, use intentUrl as callback URL.

Native app should listen to this intentUrl by which the control comes back to the native app.

Handling Callback


Entries in AndroidManifest.xml.

                        android:scheme="<protocol>" />

                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />


Entries in info.plist.

<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Handling Events from FastLink

To communicate with the events from FastLink, your application has to listen for the onMessage prop of WebView. Refer to the Step 3 code snippet, where the onMessage prop is added to the WebView.

Post Message Events

The FastLink application shares the account addition status to your application using the POST_MESSAGE events.

    "type": "POST_MESSAGE",
    "data": {
        //Post Message data

External URL

When the user clicks or taps on any external URL within the FastLink application, a native event will be triggered. You can open the URL in the SFSafariViewController or in the default browser.

    "type": "OPEN_EXTERNAL_URL",
    "data": {
        "url": "<External URL>"

Sample code to handle the events that can be used inside the onMessage webview prop.

let data =
if (data) {
    let parsedMessageData = JSON.parse(data)

    if (parsedMessageData.type == 'POST_MESSAGE') {
        let data =

        if (data.action == 'exit') {
            //You can close the webview and navigate to the other screen

    if (parsedMessageData.type == 'OPEN_EXTERNAL_URL') {
        let url =

        //Import the Linking module from the react-native
        Linking.canOpenURL(url).then((supported) => {
            if (supported) {
            } else {
                Alert.alert('Alert', 'Opening url not supported')