Branch links not working when app is first opened
See original GitHub issueEnvironment
Environment: OS: Windows 10 Node: 8.4.0 Yarn: 1.9.2 npm: 5.3.0 Watchman: Not Found Xcode: N/A Android Studio: Version 1.2.0.0 AI-141.1980579
Packages: (wanted => installed) expo: ^29.0.0 => 29.0.0 react: 16.3.1 => 16.3.1 react-native: https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz => 0.55.4
Diagnostics report: https://exp-xde-diagnostics.s3.amazonaws.com/tonicapp-95d0cd78-484d-4714-9bc2-e4a3454b8aec.tar.gz
iOS Standalone
Steps to Reproduce
- Setup Branch following the guide in the docs
Branch.subscribe
incomponentDidMount
of the root component- Kill the standalone app completely (close it in iOS)
- Tap a branch deep link that’s been created (e.g. https://my-app.test-app.link/123456)
Expected Behavior
The app should start and branch.subscribe
should be called correctly with the params
from the link tapped.
Actual Behavior
branch.subscribe
is never called on app start.
Reproducible Demo
Unfortunately, Branch is only supported in standalone apps and we can’t get a reproducible demo.
More Information
I’ve debugged this issue as far as I can without getting into the native code. Basically RNBranch.redeemInitSessionResult
is called on first subscribe
but it returns null
. This suggests there is a bug in the initialization code of Branch. Expo appears to customise this considerably, so it may be a bug on the Expo side, or it may be a bug on the Branch iOS or Branch react-native side.
Either way, it renders the feature basically useless.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:15 (12 by maintainers)
As mentioned in https://github.com/expo/expo/pull/2158 the fix was deployed for SDK 30. Make sure you’re using the latest SDK version to get the fix.
@AdamJNavarro Not sure how much of a similar issue it is but we have also had issues with Android standalone apps and Branch links opening the app.
If the Branch link is clicked when the application is closed only the initial link gets registered and called and all further links clicks are not registered by the
subscribe
function. But if the application wasn’t opened by a Branch link then the subscribe function works normally and gets called every time.Strangely this happens only on Android, on iOS everything works as expected.
I was able to create a reproducible test app using CRNA. When built via Expo it will only register the initial link with which the app was opened but all other link clicks will not call the subscribe function. Here is the repo: https://github.com/CelsiusNetwork/branch-test