> For the complete documentation index, see [llms.txt](https://docs.buildnatively.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.buildnatively.com/natively-platform/features/deep-links/branch.io.md).

# Branch.io

## What is Branch.io

Branch.io is a third-party deep linking platform that guarantees reliable navigation to your app, even if the app is not installed, by directing users to the appropriate app store. On top of standard deep linking, Branch provides link performance tracking, user journey optimization, and marketing attribution, making it a good choice for apps with active marketing campaigns.

{% hint style="info" %}
If you only need basic deep linking without attribution or analytics, consider using [Universal Links](/natively-platform/features/deep-links/universal-links.md) instead, since they require no third-party service.
{% endhint %}

## Prerequisites

* A [Branch.io](https://www.branch.io/) account.
* Your [iOS](/natively-platform/app-info/ios-build.md) and/or [Android](/natively-platform/app-info/android-build.md) app fully configured in the Natively Dashboard.

## Branch.io setup

Once your Branch.io account is created, you'll be directed to configure your app's default link behaviors. Follow the steps below to complete the setup.

### Default URL

1. Go to **App Settings** in the sidebar.
2. **Default URL:** Insert your app's URL.

### Configure Android redirects

1. Check **I have an Android App**.
2. Enter your **Android URI Scheme** - your app's **Bundle ID** in lowercase, followed by `://`. For example: `com.example.natively://`.
3. Select your app's store listing:
   * If your app is already published: select **Google Play Search** and find your app.
   * If your app is not yet published: select **Custom URL**, then enter your app's **URL** and **Bundle ID**.
4. Check the box **Enable App Links** and enter your **SHA256 certificate fingerprints**, as a comma-separated list.

{% hint style="info" %}
Your SHA256 certificate fingerprints can be found in Google Play Console under **Protected With Play** > **Play Store protection** > **Protect app signing key** > **Manage Play App Signing**.
{% endhint %}

{% hint style="info" %}
If you don't see the **Upload key certificate** content, you need to [upload](https://support.google.com/googleplay/android-developer/answer/9845334#zippy=%2Cinternal-test-manage-up-to-testers) your app first.
{% endhint %}

<figure><img src="/files/GynFnCX4eGJvkuyKnkaX" alt=""><figcaption><p>Android Redirects setup</p></figcaption></figure>

### Configure iOS redirects

1. Check **I have an iOS App**.
2. Enter your **iOS URI Scheme** - your app's **Bundle ID** in lowercase, followed by `://`. For example: `com.example.natively://` .
3. Select your app's store listing:
   * If your app is already published: select **Apple Store Search** and find your app.
   * If your app is not yet published: select **Custom URL**, then enter your app's **URL** and App Store **App ID**.
4. Check **Enable Universal Links** and enter the following:
   * **Bundle Identifier** - your app's Bundle ID.
   * **Apple App Prefix** - open your [Apple Developer account > Identifiers](https://developer.apple.com/account/resources/identifiers/list), select your app's **Bundle ID**, and copy the **App ID Prefix** shown at the top of the identifier details page.
5. Check **Enable NativeLink** and set **Audience Rule** to **All iOS traffic**.

<figure><img src="/files/Go6aosyT2KBIhQZlpUNG" alt=""><figcaption><p>iOS Redirects setup</p></figcaption></figure>

### Link Domain

1. Set up a subdomain or your own custom domain.
2. Enter your **Default Link Domain** (e.g. `yourdomain.app.link`).
3. Enter your **Alternate Link Domain** (e.g. `yourdomain-alternate.app.link`).
4. Click **Save**.

<figure><img src="/files/9rhfqke2jfaz8PA6pq7E" alt=""><figcaption><p>Link Domain setup</p></figcaption></figure>

## Natively Dashboard setup

1. Go to [Branch.io Account Settings](https://dashboard.branch.io/account-settings/profile) and copy the **Branch Key**.
2. Open your Natively app's dashboard and navigate to **Features** > **Deep Links** > **Branch**.
3. Toggle the feature to **Enabled**.
4. Enter the **Default Link Domain** from the [Link Domain](#link-domain) step above in the **Domain** field.
5. Enter the **Alternate Link Domain** from the [Link Domain](#link-domain) step above in the **Alt Domain** field.
6. Enter the **Branch Key** in the **Key** field.
7. Click **Save**.
8. Rebuild your app(s).

{% hint style="warning" %}
You must rebuild your app for these changes to take effect.
{% endhint %}

<div><figure><img src="/files/F7N2zy2lTs5vWJpICdOs" alt=""><figcaption><p>Branch Key from Branch.io Account Settings</p></figcaption></figure> <figure><img src="/files/I63TwZKIAXKDectJDfZu" alt=""><figcaption><p>Branch.io Deep Links Natively Dashboard setup</p></figcaption></figure></div>

## How to use

Once Branch.io is configured and your app is rebuilt, you can start creating deep links. A Branch deep link follows this format:

`{default_link_domain}/?$deeplink_path={url}`

**Example:**

`https://yourdomain.app.link/?$deeplink_path=https://yourdomain.io/test/reset_pw?test`

To create and manage your deep links, use the [Branch.io Dashboard](https://dashboard.branch.io).

## Troubleshooting

<details>

<summary>Deep links are not opening the app</summary>

Make sure the URI scheme, Bundle ID, and SHA256 fingerprints are correctly configured in the Branch.io dashboard. Verify that your app has been rebuilt after saving the Natively Dashboard configuration.

</details>

<details>

<summary>Google Play Data Safety section rejection</summary>

Developers are required to fill out Google's updated Data Safety section in the Google Play Console when using Branch.io. Without approval in the Data Safety section, your new app submission or app update may be rejected.

For detailed information on completing the Google Play Store questions: [Answering the Google Play Store Privacy Questions](https://help.branch.io/using-branch/docs/answering-the-google-play-store-privacy-questions).

</details>

<details>

<summary>Branch Key not working</summary>

Make sure you are using the correct Branch Key from your [Branch.io Account Settings](https://dashboard.branch.io/account-settings/profile). Verify that the Default and Alternate Link Domains match exactly what is configured in Branch.io.

</details>

<details>

<summary>Universal Links not working on iOS</summary>

Make sure **Enable Universal Links** and **Enable NativeLink** are both checked in the Branch.io dashboard. Verify that the Bundle Identifier and Apple App Prefix are correctly entered.

</details>
