Skip to main content
Package: com.truv.sdk:android_sdk | Maven Central | Demo app

Install

Add the Truv SDK to your module’s build.gradle:
dependencies {
    implementation "com.truv.sdk:android_sdk:LATEST_VERSION"
}
Make sure mavenCentral() is included in your project’s repository configuration. Add the INTERNET permission to your AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />

Embedded Orders

Use TruvOrderView to embed an Order, a multi-connection verification workflow that supports multiple data sources and product types. Add to your layout XML:
<com.truv.webview.TruvOrderView
    android:id="@+id/orderView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
Or create programmatically:
val orderView = TruvOrderView(context)
Initialize and load:
import com.truv.models.TruvEventPayload
import com.truv.models.TruvOrderEvent
import com.truv.webview.TruvOrderEventsListener
import com.truv.webview.TruvOrderView

class MyFragment : Fragment() {

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        val orderView = view.findViewById<TruvOrderView>(R.id.orderView)

        orderView.addEventListener(object : TruvOrderEventsListener {

            override fun onOrderEvent(event: TruvOrderEvent) {
                when (event) {
                    is TruvOrderEvent.Load -> {
                        // Order page finished loading
                    }

                    is TruvOrderEvent.Close -> {
                        // User closed the Order
                    }

                    is TruvOrderEvent.Success -> {
                        // A task within the Order completed successfully.
                        // The Order is still open at this point — it may show
                        // a success screen or a self-certification screen
                        // depending on the configuration.
                    }

                    is TruvOrderEvent.Completed -> {
                        // The entire Order is complete (all tasks finished)
                    }
                }
            }

            override fun onBridgeEvent(event: TruvEventPayload) {
                // Fired when the user interacts with the Bridge for a
                // sub-order (task) within the Order.
                // Equivalent to TruvEventsListener.onEvent().
            }
        })

        orderView.loadOrderUrl(orderToken)
    }
}

Bridge Widget

Use TruvBridgeView for single-connection flows like Direct Deposit Switch and Paycheck Linked Lending. Add to your layout XML:
<com.truv.webview.TruvBridgeView
    android:id="@+id/bridgeView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
Or create programmatically:
val bridgeView = TruvBridgeView(context)
Initialize and load:
import com.truv.models.TruvEventPayload
import com.truv.models.TruvSuccessPayload
import com.truv.webview.TruvBridgeView
import com.truv.webview.TruvEventsListener

class MyFragment : Fragment() {

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        val bridgeView = view.findViewById<TruvBridgeView>(R.id.bridgeView)

        bridgeView.addEventListener(object : TruvEventsListener {

            override fun onLoad() {
                // Bridge finished loading
            }

            override fun onClose() {
                // User closed the Bridge
            }

            override fun onSuccess(payload: TruvSuccessPayload) {
                // Called when the Bridge closes after a successful task.
                // payload.publicToken — use this to retrieve data server-side.
                // payload.metadata.taskId — the task identifier.
            }

            override fun onEvent(event: TruvEventPayload) {
                // Lifecycle event — see Bridge Events for all types.
            }
        })

        bridgeView.loadBridgeTokenUrl(bridgeToken)
    }
}
See Bridge Events for all event types, payloads, and error codes.

Sample app

Android Demo (Kotlin)

Kotlin demo using the Truv Android SDK
1

Clone the repo

Clone the demo app from GitHub and install dependencies.
2

Add your API keys

Copy your Client ID and Access Secret from the Dashboard into the app’s configuration file.
3

Run in sandbox mode

Use sandbox test credentials to simulate a full verification flow. Use the demo app as a reference to understand how the SDK works.
4

Integrate the SDK into your app

Follow the implementation guide above to add Truv Bridge to your own application.
5

Go live

Swap in production credentials in your app when ready.