Branch subscribe not working

Hi, Im having trouble getting Branch.io to work on android in the standalone builds. I`ve tried expo 23/24 but both dont work.

Branch.subscribe(({ error, params }) => { Alert.alert(“hallo”); });

Opening the app through the branch link wont trigger the subscribe.

4 Likes

Are you importing branch using Expo.DangerZone.Branch?

1 Like

Im importing it exactly as in the comments. I also watched the logcat and it seemed fine.
Should I be able to rebuild the behavoiur with the Linking Module ?

Im importing it exactly as in the comments

Not sure what this means exactly. Can you share your code?

1 Like

Hi @jesse, thanks for your reply. I am currently working with @trunken on this app and after putting it back for a while we still could not solve this problem.

This is all the code we added involving the Branch SDK.


  componentDidMount(){
    Linking.addEventListener('url', this._handleUrl);
    Expo.DangerZone.Branch.subscribe((bundle) => {
      if (bundle && bundle.params && !bundle.error) {
        console.log(bundle);
      }
    });
  }

This code is placed in the first component of the App.

As you may see, we also tried out the Linking module after Branch wasn’t working. This actually recognizes the link but since Branch only passed the link_click_id we didn’t get the link-data yet with this.

We checked the branch-key in the app.json multiple times and yet tested the behaviour on multiple Android devices (App Links enabled in the Branch link settings). Unfortunately we are not able to test on ios currently.

Do you have any further ideas which could be the problem?
Thanks,
Julius

in the adb logcat we see this error:

01-22 10:43:14.875 27690 27690 E h       : java.lang.ClassNotFoundException: abi24_0_0.host.exp.exponent.modules.api.branch.RNBranchModule
01-22 10:43:14.895 27690 27690 E h       : Runtime exception in RNObject when calling method initSession: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.reflect.Method[] java.lang.Class.getMethods()' on a null object reference
01-22 10:43:15.365 27690 27690 E h       : java.lang.ClassNotFoundException: abi24_0_0.com.facebook.soloader.SoLoader
01-22 10:43:15.365 27690 27690 E h       : Runtime exception in RNObject when calling method init: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.reflect.Method[] java.lang.Class.getMethods()' on a null object reference

overall looks very similar to this issue

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.