Skip to content

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

@virajpsimformsolutions

Description

@virajpsimformsolutions

❗️ 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:

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

❌ Actual Behavior

onOpenComplete fires but parameters are empty:

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

getFirstReferringParams() also returns:

{ "+clicked_branch_link": false }

🔁 Reproduction Steps

1. Create new Expo app

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

2. Install Branch dependencies

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

3. Configure app.config.js

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

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 (
    <View style={styles.container}>
      <Text>Branch Test</Text>
      <Button title="Test Link (Works)" onPress={() => branch.openURL('https://yourapp.test-app.link/test')} />
    </View>
  );
}

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

5. Build iOS dev client

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions