expo / expo/config-plugins

Branch.subscribe() not receiving deep link params on cold start with Expo SDK 54 (iOS)

Open
#295 4 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
567
Forks
136
PR merge metrics
No merged PRs in 30d

Description

# ❗️ Branch.io Deep Link Not Working on iOS Cold Start (Expo SDK 54 + react-native-branch 6.8.0)

## πŸ“ Summary

When opening the app from a **Branch.io deep link on a cold start** (via
QR code, Safari, or Messages),\
`branch.subscribe()` fires `onOpenComplete` but **does not return proper
deep link parameters**.

`+clicked_branch_link` is always **false** and all metadata is missing.

This issue occurs **only on iOS** and only when the app is **cold
started**.

------------------------------------------------------------------------

## πŸ“± Environment

Library / Platform Version
----------------------- ----------------------------------------------
`react-native-branch` 6.8.0
Expo SDK 54
React Native 0.79
Platform iOS
Build Type EAS Custom Dev Client (not Expo Go)
Branch Config Plugin `@config-plugins/react-native-branch` 11.0.0

------------------------------------------------------------------------

## βœ… Expected Behavior

When opening the app from a Branch link on cold start:

- `onOpenStart` should receive the **URI**

- `onOpenComplete` should return parameters including:

``` json
{
"+clicked_branch_link": true,
"~campaign": "...",
"testParam": "testValue"
}
```

------------------------------------------------------------------------

## ❌ Actual Behavior

`onOpenComplete` fires but parameters are empty:

``` json
{
"error": null,
"params": {
"+is_first_session": false,
"+clicked_branch_link": false
},
"uri": null
}
```

`getFirstReferringParams()` also returns:

``` json
{ "+clicked_branch_link": false }
```

------------------------------------------------------------------------

## πŸ” Reproduction Steps

### 1. Create new Expo app

``` sh
npx create-expo-app@latest branch-test --template blank-typescript
cd branch-test
```

### 2. Install Branch dependencies

``` sh
npx expo install react-native-branch @config-plugins/react-native-branch
```

### 3. Configure `app.config.js`

``` javascript
export default {
name: "branch-test",
slug: "branch-test",
version: "1.0.0",

ios: {
bundleIdentifier: "com.yourcompany.branchtest",
associatedDomains: [
"applinks:yourapp.test-app.link",
"applinks:yourapp-alternate.test-app.link"
],
config: {
branch: {
apiKey: "key_test_xxxxxxxxxxxxxx"
}
}
},

plugins: [
[
"@config-plugins/react-native-branch",
{
apiKey: "key_test_xxxxxxxxxxxxxx",
iosAssociatedDomains: ["applinks:yourapp.test-app.link"]
}
]
]
};
```

### 4. Use this test `App.tsx`

``` tsx
import { useEffect } from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
import branch from 'react-native-branch';

export default function App() {
useEffect(() => {
const unsubscribe = branch.subscribe({
onOpenStart: ({ uri, cachedInitialEvent }) => {
console.log('🟒 onOpenStart - URI:', uri);
console.log('🟒 cachedInitialEvent:', cachedInitialEvent);
},
onOpenComplete: ({ error, params, uri }) => {
console.log('πŸ”΅ onOpenComplete:', JSON.stringify({ error, params, uri }, null, 2));
console.log('πŸ”΅ +clicked_branch_link:', params?.['+clicked_branch_link']);
}
});

setTimeout(async () => {
const firstParams = await branch.getFirstReferringParams();
console.log('πŸ” getFirstReferringParams:', JSON.stringify(firstParams, null, 2));
}, 3000);

return () => unsubscribe();
}, []);

return (

Branch Test
branch.openURL('https://yourapp.test-app.link/test')} />

);
}

const styles = StyleSheet.create({
container: { flex: 1, justifyContent: 'center', alignItems: 'center' }
});
```

### 5. Build iOS dev client

``` sh
npx expo prebuild --clean
eas build --platform ios --profile development
```

### 6. Test

1. Kill the app\
2. Tap a Branch Universal Link\
3. Observe console

------------------------------------------------------------------------

## πŸ“‚ Test Branch Link Parameters

Created in dashboard:

- URL: `https://yourapp.test-app.link/test`
- Campaign: `test-campaign`
- Data: `{ "testParam": "testValue" }`

------------------------------------------------------------------------

## πŸ”Ž Observed Behavior Logs

### **Expected (but not happening):**

🟒 onOpenStart URI: https://yourapp.test-app.link/test
πŸ”΅ +clicked_branch_link: true

### **Actual:**

πŸ”΅ +clicked_branch_link: false
πŸ”΅ uri: null
πŸ”΅ params: { "+is_first_session": false }

------------------------------------------------------------------------

## πŸ§ͺ Additional Observations

------------------------------------------------------------------------
Scenario Works? Notes
----------------------------- ---------------------- -------------------
Safari Universal Link (cold ❌ Params missing
start)

QR Code (cold start) ❌ Same issue

App already running (warm ⚠️ Sometimes But still
start) unreliable

Using `branch.openURL()` βœ… Always returns
internally correct params

Deferred linking ❌ Always empty
(`getFirstReferringParams`)

Associated Domains configured βœ… Verified

appleTeamId set βœ… Verified
------------------------------------------------------------------------

------------------------------------------------------------------------

## πŸ”š Problem Summary

Branch fails to deliver **any** deep link parameters on **cold start on
iOS**, even though:

βœ”οΈ Associated domains are valid\
βœ”οΈ Branch SDK initializes\
βœ”οΈ App opens correctly\
❌ `+clicked_branch_link` stays `false`\
❌ No campaign or custom data is delivered

This breaks **universal links, QR code flows, onboarding, and deferred
deep linking**.

------------------------------------------------------------------------

## πŸ™ Request

Please investigate why Branch params are not delivered to React Native
apps on **iOS cold start** when using:

- Expo SDK 54\
- React Native 0.79\
- react-native-branch 6.8.0\
- Config Plugins\
- EAS Dev Client

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.