react-native-branch-deep-linking-attribution icon indicating copy to clipboard operation
react-native-branch-deep-linking-attribution copied to clipboard

iOS ~50% appstarts, branch does not work at all.

Open musemind opened this issue 5 years ago • 11 comments

I implemented react-native-branch in an expo managed app with the expo wrapper.

At about 40-50% of the iOS app starts in production, the branch sdk does nothing at all. Then callback of .subscribe() is never called. The getLatestReferringParams() promise is not resolved. I thought this has something to do with timing and tested different subscription call points during runtime, but it does not help.

Do you have any ideas?

This is only on iOS, Android works fine.

musemind avatar Nov 01 '19 10:11 musemind

I have the same issue, does someone know what can cause it?

Syesy avatar Nov 27 '19 10:11 Syesy

I discovered that the native driver don't call the api endpoint api2.branch.io/v1/open and so the subscribe callback is not fired. But i still don't know why this happen.

Syesy avatar Nov 27 '19 21:11 Syesy

Are you ejecting the expo app and implementing the lifecycle methods? These lifecycle calls happen before the JS layer is ready, so they must be in native code. Both platforms make some some attempt to recover, but Android is more aggressive about it.

echo-branch avatar Nov 27 '19 21:11 echo-branch

Thanks for your reply, but currently i'm not ejecting the expo app. I noticed that expo SDK 35 is using an old version of this library, in particular version 3.1.1. Maybe some fix about that have been done in latest version?

Syesy avatar Nov 29 '19 14:11 Syesy

I've updated to SDK 36 wich is using the latest version of react-native-branch-deep-linking-attribution and I still have the same problem

Syesy avatar Dec 13 '19 18:12 Syesy

Hey this is a non-trivial feature request to support expo without ejecting. Our currently supported integration is ejecting the expo app and setting up in native code.

Technical reason is that iOS lifecycle works differently from Android and hooking into it automatically is dangerous within an SDK. We've seen conflicts with other SDKs and client code by trying to do that kind of magic.

echo-branch avatar Dec 13 '19 19:12 echo-branch

In fact the problem is related to expo. I think we can close this one. Thanks for your help

Syesy avatar Dec 22 '19 14:12 Syesy

I am also facing this problem in some of the iOS devices in the Production app. It always opens the app but didn't call the listener. If the app is running in background and user taps on the link, it calls the listener.

I am not using expo. It mostly happens on iOS 13.5.1 version devices. Please help as it's breaking the user redirections.

React-Native version - 0.61.1 Branch version - 4.2.1 npm version - 6.13.7 node version - v13.11.0

aadityapaliwal94 avatar Jul 28 '20 12:07 aadityapaliwal94

@aadityapaliwal94 In the future, please open a separate issue if you're not using the same setup as the original issue report.

Did you remember to implement the iOS lifecycle methods in native code? Linking code is handled before react native is ready, and therefore must be native code.

Are you using UIScenes? If so, there's a known bug where the app callback is not called in some situations. You'll need to use a workaround. See the SceneDelegate sample code in the following document. https://help.branch.io/developers-hub/docs/ios-basic-integration

echo-branch avatar Jul 28 '20 19:07 echo-branch

Sorry @echo-branch, will remember to open a new issue :)

Yes, I did implement all iOS lifecycle methods which define here https://help.branch.io/developers-hub/docs/react-native in AppDelegate. I am sure, I am not using any UIScenes in the app,

It's very critical. Please help

Thanks.

aadityapaliwal94 avatar Jul 29 '20 03:07 aadityapaliwal94

Thanks @echo-branch. I have created one here https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution/issues/600

aadityapaliwal94 avatar Jul 29 '20 09:07 aadityapaliwal94