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

Android subscribe listener params.+clicked_branch_link sometimes false

Open mlaythe opened this issue 3 years ago • 0 comments

params sometimes is set to: {"+clicked_branch_link": false, "+is_first_session": false} on android. I haven't noticed this issue occurring with ios.

useEffect(() => {
    branch.subscribe(({
      error,
      params,
    }: any) => {
      if (error) {
        console.error("Error from Branch: " + error);
        return;
      }
      if (!params) return;

      // params will never be null if error is null

      if (params["+non_branch_link"] || !params["+clicked_branch_link"]) {
        // +non_branch_link
        // Route non-Branch URL if appropriate.

        // +clicked_branch_link
        // Indicates initialization success and some other conditions.
        // No link was opened.
        return;
      }
    });
  }, []);

per: https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution/issues/707 my MainActivity.java is already using:

@Override
    public void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        RNBranchModule.onNewIntent(intent);
    }

I also tried playing with onOpenComplete per: https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution/issues/670 with no luck.

I'm rocking:

"react-native": "0.64.3",
"react-native-branch": "5.4.1"

Any ideas/thoughts on how to get android to work consistently? Something I'm messing up on the config end, perhaps?

mlaythe avatar Aug 10 '22 20:08 mlaythe