Branch.subscribe() not receiving deep link params on cold start with Expo SDK 54 (iOS)
- 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
Assessment
This issue has not been assessed yet.