> ## Documentation Index
> Fetch the complete documentation index at: https://docs.median.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Branch.io

> Add deferred deep linking with Branch.io.

The **Branch.io plugin** enables **deferred deep linking** within your app, allowing users to navigate directly to specific content even after installing the app. The plugin is built on the **Branch SDK for iOS and Android** ([Branch SDK overview](https://help.branch.io/developers-hub/docs/native-sdks-overview)) and routes users to the right content through deep links.

This guide provides step-by-step instructions for configuring the plugin and utilizing its features through the [Median JavaScript Bridge](https://docs.median.co/docs/javascript-bridge.md).

> [!TIP]
>
> **Test  with our demo page**
>
> We host a ready-made demo page at
>
> that calls the  features through the Median JavaScript Bridge.
> Load it inside your Median app during development, either by setting it
> as your app's website URL in App Studio or by navigating to it from your
> own site, and use it to confirm  works on a real device before
> you add it to your own pages.
>
> The demo page only works inside a Median app with  enabled.
> Opened in a regular mobile or desktop browser, the native features
> won't respond. Remember to switch your app back to your own URL before
> release.

## Implementation guide

### Plugin configuration

To set up the Branch.io plugin, update the required parameters in the **Native Plugins** tab under **Branch.io**:

![Branch.io plugin settings in the Native Plugins tab of App Studio](https://mintcdn.com/median-co/dZQPJ_0wlG7WNBTy/images/docs/46de228279749e1126620631cbf86a61ed09497a1d51f693c064406a6e3f4892-Screenshot_2025-07-04_at_12.30.04.png?fit=max\&auto=format\&n=dZQPJ_0wlG7WNBTy\&q=85\&s=d38ee2e74169b3bb0a0abaeeba577de3)

Branch.io plugin configuration

#### Sample JSON

You can copy the following JSON file in the Advanced Configuration and replace the `String` and `Boolean` placeholders by following the instructions below.

```json JSON theme={null}
{
  liveKey: String, // required
  testKey: String, // optional
  linkDomain: String, // optional
  alternateLinkDomain: String, // optional,
  testLinkDomain: String, // optional
  testAlternateLinkDomain: String, // optional
  uriScheme: String, // optional
  enableTestMode: Boolean // optional, default is false
}
```

#### Retrieving configuration values

Access Branch.io values from the Branch Dashboard ([https://dashboard.branch.io](https://dashboard.branch.io)) and apply them in Median App Studio.

##### Live mode configuration

1. **Branch Key** (Required)

* **Path**: *Account Settings → Profile → Branch Key*
* **Usage**: Set as `liveKey`.

2. **App Link Domains** (Required for deep linking)

* **Path**: *Configuration → General → Link Domain*

* **Usage**:
  * `linkDomain` (Primary domain for deep linking)
  * `alternateLinkDomain` (Required for Journeys/Web SDK and Deepviews)

3. **URI Scheme** (Optional for app redirection)

* **Path**: *Configuration → General → Android Redirects*
* **Usage**: Set as `uriScheme`.

##### Test mode configuration

For testing purposes, **enable Test Mode on the Branch.io Dashboard** and set `enableTestMode` to `true` in the configuration.

1. **Test Branch Key**

* **Path**: *Account Settings → Profile → Branch Key*
* **Usage**: Set as `testKey`.

2. **Test App Link Domains**

* **Path**: *Configuration → General → Link Domain*

* **Usage**:
  * `testLinkDomain` (Test version of the link domain)
  * `testAlternateLinkDomain` (Test version of the alternate domain)

### Branch.io configuration

Enable Android-specific deep linking features in your Branch Dashboard:

1. Navigate to Android Redirects settings.
2. Enable "I have an Android App" and "Enable App Links".
3. Ensure SHA256 Cert Fingerprints are correctly configured.

> [!WARNING]
>
> **SHA256 Cert Fingerprints**
>
> It’s important to specify the SHA256 Cert Fingerprints for App links to work properly on Android. For details, see [Branch's guide to configuring default link behaviors](https://help.branch.io/using-branch/docs/configure-default-link-behaviors).

### JavaScript Bridge functions

#### Initialized callback

The app calls this callback function when the Branch SDK has finished initializing and returns data from the link that referred the current session.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median_branch_initialized(data){}
// Return value:
{
  'success': Boolean,
  'error': String,
  'data': {}
}
```

#### Get first parameters

Returns the data from the link that first referred the user. This is only set once, the first time the user is referred by a link.

Provide a callback function or otherwise a promise is returned.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.branch.getFirstParams({'callback': function})
// Return value
// see https://help.branch.io/using-branch/docs/creating-a-deep-link#data-structure
```

#### Get latest parameters

Returns the data from the link that referred the current session.

Median JavaScript Bridge

```javascript JavaScript theme={null}
median.branch.getLatestParams({'callback': function})
// Return value
// see https://help.branch.io/using-branch/docs/creating-a-deep-link#data-structure
```

### Testing your integration

#### Quick link test

1. Create a Quick Link in the Branch Dashboard.
2. Copy the generated link.
3. Paste the link into a messaging or notes app on your test device.
4. Tap the link to make sure it correctly redirects to your app.

If configured correctly, the user should be redirected into your app, with deep link data accessible through the JavaScript Bridge methods.


## Related topics

- [Integrations](https://docs.median.co/docs/integrations.md)
- [Analytics](https://docs.median.co/docs/analytics.md)
- [Customer.io](https://docs.median.co/docs/customerio.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.