Skip to main content

5. Navigation Graph Integration

This section explains how to integrate the Metric SDK's navigation graph with your app's navigation component. The Metric SDK uses Android Jetpack's Navigation component for handling navigation between screens.

To display identity verification screens, your parent application must use the Navigation component and integrate the Metric SDK's navigation graph.

Here's an example of how your app's navigation graph XML could look:

<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/nav_graph"
...>

<include app:graph="@navigation/metric_nav_graph" />

... <!-- other fragments in your app -->
</navigation>

n this example, <include app:graph="@navigation/metric_nav_graph" /> includes the Metric SDK's navigation graph within your app's main navigation graph. This allows your app to navigate to the identity verification screens provided by the Metric SDK.

This integration ensures that the Metric SDK's identity verification screens are seamlessly integrated into your app's navigation flow.