Branch Deep Links Setup for iOS and Android: Best Complete Guide (2026)
A deep link that opens the app’s home screen instead of the product page, or opens Safari instead of the app at all, wastes the click you paid for. This Branch deep links setup guide covers the full path for iOS and Android: dashboard configuration, Universal Links, App Links, SDK initialization, deferred deep linking, events and testing.The details below follow Branch’s developer documentation, checked in October 2026. Several things in older tutorials no longer match it, including the CocoaPods name, the Info.plist format and the way revenue events work, and I point those out as they come up. If you are new to the topic, read
what mobile attribution is first.
What Branch Does and What It Costs
Branch is a linking and measurement platform for mobile. Its links open a specific screen in your app, send users who do not have the app to the store, and then deliver the original link data after install. That last part is deferred deep linking.
Branch Pricing
Branch’s
pricing page lists three plans: Basics, Essentials and Enterprise. It offers a free trial on Basics, does not publish prices, and does not list a permanent free tier, so older claims that Branch is freemium are not backed by the current page. Ask for current terms before you plan around it. Branch’s documentation also notes that deep linking requires its Engagement product.
Branch or AppsFlyer OneLink
If AppsFlyer already handles your attribution, its OneLink feature may cover your deep linking needs, as described in the
AppsFlyer setup guide. Branch is worth considering when linking and web-to-app journeys are your main requirement. For the wider vendor picture, see
AppsFlyer vs Adjust.
Step 1: Configure Your App in the Branch Dashboard
Everything on the device must match what the dashboard says, so start there. According to Branch’s
iOS integration guide, in the current dashboard you set your iOS URI scheme and URL under Link Routing Rules, then Mobile Routing, enable Universal Links, enter your Apple Team ID as the App Prefix and add your bundle IDs. Older accounts use the App Settings page for the same fields. Confirm that the bundle identifier in Xcode matches the one in the dashboard.Your account also has a link domain. By default it looks like
xxxx.app.link, with an
xxxx-alternate.app.link twin, and you can switch to a custom domain later. Note your domain now, because you will need it on both platforms.
Step 2: iOS Setup
Install the SDK
With Swift Package Manager, add the
ios-branch-sdk-spm package from Branch in Xcode. With CocoaPods, the pod is named
BranchSDK for SDK 2.0.0 and later, not
Branch as older posts show:
pod 'BranchSDK'
Branch’s guide also lists frameworks to link: CoreServices, SystemConfiguration, WebKit and CoreSpotlight.
Set Up Associated Domains
In Xcode, open Signing and Capabilities and add the Associated Domains capability. Use this format for each entry, replacing xxxx with your assigned subdomain prefix:
applinks:xxxx.app.link
applinks:xxxx-alternate.app.link
applinks:xxxx.test-app.link
applinks:xxxx-alternate.test-app.link
The alternate domain is required. Branch’s guide says it is needed for Universal Links to function properly. The two
test-app.link entries matter only if you use a test key. If you have a custom link domain, Branch’s
Universal Links guide says to include your old domain, its alternate domain and your new domain.
Add Branch Keys to Info.plist
The
branch_key entry is a dictionary with a live key and an optional test key, not a single string. Add your link domains and your URI scheme too:
<key>branch_key</key>
<dict>
<key>live</key>
<string>key_live_YOUR_KEY</string>
<key>test</key>
<string>key_test_YOUR_KEY</string>
</dict>
<key>branch_universal_link_domains</key>
<array>
<string>xxxx.app.link</string>
<string>xxxx-alternate.app.link</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>yourapp</string>
</array>
<key>CFBundleURLName</key>
<string>com.yourcompany.yourapp</string>
</dict>
</array>
Initialize the Session
Do not put
initSession inside a SwiftUI
App initializer, as older posts do. Branch’s guide describes this structure for SwiftUI apps: an AppDelegate that calls
initSession, a SceneDelegate that forwards user activities and URL contexts to
BranchScene.shared(), and
@UIApplicationDelegateAdaptor in your App file. Follow the exact scene code in Branch’s guide, including its cold-start handling, because it is easy to get subtly wrong. The core call is simple:
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Branch.getInstance().initSession(launchOptions: launchOptions) { params, error in
// params holds the deep link data, including deferred links after install
}
return true
}
For UIKit apps without scenes, Branch also asks you to forward
open url to its handler and universal links to
continue(userActivity).
Step 3: Android Setup
Add the Dependency and Manifest Entries
Branch’s
Android integration guide lists the library
io.branch.sdk.android:library, at version 5.8.0 in its example, and says to check for the latest version.
implementation 'io.branch.sdk.android:library:5.8.0'
In the manifest, add your keys inside the application element. Test mode is a manifest setting, and it should be false for release builds:
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_YOUR_KEY" />
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_YOUR_KEY" />
<meta-data android:name="io.branch.sdk.TestMode" android:value="false" />
Add App Links and the URI Scheme
Put the App Links filter on the activity that should open from link clicks, as its own separate intent filter. Branch’s
App Links guide shows one data element per domain:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="xxxx.app.link" />
<data android:scheme="https" android:host="xxxx-alternate.app.link" />
<data android:scheme="https" android:host="xxxx.test-app.link" />
<data android:scheme="https" android:host="xxxx-alternate.test-app.link" />
</intent-filter>
Add a second intent filter with your custom URI scheme as the fallback, and set the launcher activity to
android:launchMode="singleTask". If you use a custom domain, add its data element as well. Android verifies every host in the filter, and if one fails, none of the patterns are verified.Enable App Links in the Branch dashboard under the Android configuration and paste your SHA256 certificate fingerprint. For testing you can add the debug and production fingerprints separated by a comma, but make sure the release fingerprint is present before you ship. Every domain in your manifest must serve a Digital Asset Links file at
/.well-known/assetlinks.json. For your own custom domain, confirm in Branch’s documentation or with Branch support exactly who serves that file, instead of assuming.
Initialize the Session
Create an Application class that enables logging for debug builds and gets the Branch instance:
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Branch.enableLogging() // debug builds only
Branch.getAutoInstance(this)
}
}
Then start the session in the launcher activity’s
onStart. Branch warns that using
onCreate or
onResume causes unintended behavior.
override fun onStart() {
super.onStart()
Branch.sessionBuilder(this)
.withCallback { branchUniversalObject, linkProperties, error ->
if (error != null) {
Log.e("Branch", error.message)
} else {
// read the link data from branchUniversalObject and linkProperties
}
}
.withData(this.intent?.data)
.init()
}
Handle links that arrive while the app is already running. In
onNewIntent, call
setIntent(intent), and if the intent carries the
branch_force_new_session extra, build a new session with a callback and call
reInit(). Branch’s guide shows the exact code.
Step 4: Create and Test Links
Create a link in the Branch dashboard, add the key-value data your app should read, such as a screen name and a product ID, and set the fallback behavior. Your app reads those values in the session callback on both platforms. Use your own data keys, and keep them consistent between the link and the code that parses them.
Test Direct Deep Links
Branch’s testing guidance has several practical rules:
- Do not test Universal Links by typing the link into Safari’s address bar, because Apple blocks that path. Use the Notes app or Messages.
- iOS only fetches the apple-app-site-association file on a fresh install or an App Store update, so delete and reinstall after changes.
- Do not wrap Branch links in a click-tracking or redirect link, because they must stand alone.
- On Android, make sure your browser is not the default handler for the link domain, and keep all link domains publicly reachable.
- App Links work only on Android 6 and later.
Test Deferred Deep Links
Branch documents this flow on its Android testing page. Create a link in the dashboard, remove the app from the test device and reset the advertising ID, reinstall the build, paste the link into another app and tap it. The app should open and route to the right screen. On Android you can also call
IntegrationValidator.validate in
onStart to check your keys, package name, URI schemes and link domain against the dashboard, then remove it for production builds.
Step 5: Track Events and Revenue
Use a standard purchase event for money. Branch states that revenue is only aggregated in reporting when it is tracked on a purchase event, and that commerce metadata cannot be attached to custom events. Older posts that log a custom event named “purchase” with revenue as a text property will not produce the revenue reports you expect.
// iOS
let buo = BranchUniversalObject()
buo.canonicalIdentifier = "item/12345"
let event = BranchEvent.standardEvent(.purchase)
event.contentItems = [buo]
event.transactionID = "order_12345"
event.currency = .USD
event.revenue = 29.99
event.logEvent()
// Android
val buo = BranchUniversalObject()
.setCanonicalIdentifier("item/12345")
BranchEvent(BRANCH_STANDARD_EVENT.PURCHASE)
.setTransactionID("order_12345")
.setCurrency(CurrencyType.USD)
.setRevenue(29.99)
.addContentItems(buo)
.logEvent(applicationContext)
If you leave out the currency, Branch assumes USD, so set it explicitly. For non-commerce actions, create a custom event with a descriptive name that does not reuse a standard event name. Branch’s
event tracking guide lists the standard event types.
Common Branch Deep Links Setup Mistakes
- Missing the alternate domain. Add both the main and alternate domain to Associated Domains and to the Android intent filter.
- Wrong or missing SHA256 fingerprint. A debug-only fingerprint breaks App Links for release builds.
- Initializing in the wrong lifecycle method. On Android use
onStart, and handle onNewIntent for links that arrive while the app is open. - Using a single string for branch_key. The current format is a dictionary with live and test keys.
- Testing only direct links. Always run the uninstall, click, reinstall flow too.
- Shipping test mode. Keep the test key and test mode out of release builds.
- Logging revenue as a custom event. Use the standard purchase event.
When your links work but numbers still look wrong, the
mobile attribution audit and the
iOS attribution fix guide are the next stops.
Web-to-App Journeys
Branch also offers web-to-app features, such as banners on a mobile site that send visitors to your app. Those use Branch’s web SDK and dashboard tools, and their setup changes more often than the native SDKs, so this guide stays with the app side. Follow Branch’s current web documentation for that part.
FAQ
What is deferred deep linking?
Deferred deep linking sends a user to the right screen even when the app is not installed yet. The user taps a link, installs the app from the store, and on first launch the app receives the original link data and opens the matching content.
Do I need to add the alternate domain for Branch Universal Links?
Yes. Branch’s documentation lists the alternate domain as required for Universal Links to work properly. Add the main app.link domain and the alternate domain, plus the test domains if you use a test key, and your custom domain if you have one.
Is Branch free?
Branch’s pricing page lists Basics, Essentials and Enterprise plans, with a free trial on Basics and no prices published. It does not list a permanent free tier, so check the pricing page or ask Branch sales for current terms.
Why does my Branch link open Safari instead of my app?
Common causes are a missing alternate domain in Associated Domains, a Team ID or bundle ID that does not match the dashboard, a link wrapped inside a click tracker, or testing by typing the link into Safari’s address bar. Test from the Notes app and reinstall after changes.
How do I test Branch deferred deep links?
Create a link in the Branch dashboard, remove the app from a test device, reinstall the build, paste the link into another app and tap it. After install the app should open and route to the right screen. Branch also provides an integration validator for Android.
Can I use Branch together with AppsFlyer or Adjust?
Yes, many teams do, but give each tool a clear job so links and attribution do not conflict. If you already use AppsFlyer, check whether its OneLink deep linking covers your needs before adding another link provider.
How do I track purchases with Branch?
Log a standard purchase event with the Branch SDK and set revenue, currency and a transaction ID on that event. Branch states that revenue is only aggregated in reporting when it is tracked on a purchase event, so avoid sending revenue as a custom event property.If you want help with a Branch deep links setup that is failing silently, send your platform and a short description to
contact@alfahadhridoy.com and I will reply by email.