React-native-branch-deep-linking-attribution: Trouble getting deferred deep link working

Created on 26 Apr 2018  路  8Comments  路  Source: BranchMetrics/react-native-branch-deep-linking-attribution

I'm trying to get deferred deep linking working but have run into some problems. In my top level file I create a subscriber like so:

branch.subscribe(({error, params}) => {
  console.log(params)
})

When I click a deep link after installing the app I get something like this:

{ '+is_first_session': false,
'+clicked_branch_link': false,
'+non_branch_link': 'https://myapp.app.link/ewf23...' }

When I try to do deferred deep linking via click link -> install -> open app, I get this:

{ '+is_first_session': false,
'+clicked_branch_link': false,
cached_initial_event: true }

This suggests that branch did in fact cache something but I don't see anywhere in the documentation how to retrieve this info. I tried doing branch.getLatestReferringParams() and branch.getFirstReferringParams() but neither of these methods were able to give me back the link url:
latestParams = { '+is_first_session': false, '+clicked_branch_link': false }
firstParams = {}

I can't tell what's wrong and was hoping someone could point me in the right direction. Thanks!!

Most helpful comment

Mee too... for me it happens on ios only.

All 8 comments

Mee too... for me it happens on ios only.

@stefanlenoach @blastering66

Have you tested this with web view examples. Is it working for you with the branch examples ? We tried to replicate it on them and it seems to be working as expected. We will be glad to help you to solve this issue .

One thing we noticed while trying to replicate the issue is that if the URL is configured wrong it will create it as a non branch link .

I seem to also get this.

@sequoiaat what is the expected behaviour? If I call subscribe in one component and then later call subscribe again on a different view should they both see the initial params?

The expected behaviour is, if we're clicking a branch link then we get {'+is_first_session': false,
'+clicked_branch_link': true,{{the referring link and with parameters if any}}}.

For e.g., {"~referring_link":"https://ms9y.test-app.link/axXS9n5XZM","+click_timestamp":1526579796,"$identity_i
d":"518347959956831852","source":"android","$og_image_url":"https://upload.wikimedia.org/wikipedia/commons/e/e5/Venus-real_color.jpg","~creation_source":2,"$deeplin
k_path":"en.m.wikipedia.org/wiki/Venus","$canonical_identifier":"planet/Venus","$publicly_indexable":"true","$ios_deepview":"branch_default","$canonical_url":"https
://en.wikipedia.org/wiki/Venus","~channel":"Copy","$og_title":"Venus","+match_guaranteed":true,"prop2":"abc","prop1":"test","~feature":"share","$rating_average":4.2
,"$desktop_url":"https://en.wikipedia.org/wiki/Venus","$one_time_use":false,"$android_deeplink_path":"en.m.wikipedia.org/wiki/Venus","+is_first_session":false,"+cli
cked_branch_link":true,"~id":"525720443693736678"}.

If you need to pass custom data along with url you can pass it by setting contentmetadata along with the link properties or else you can pass it as a query string (https://docs.branch.io/pages/apps/react-native/#create-content-reference)

@Jonovono I think its not possible, cross check. Subscribe method works in appcomponent only, you can't bind it in any other events if that is the case you can use getlatestrefering params or getfirstrefering param methods

Hope this is ok now. We are closing it, please re-open if you are facing any issue.

I am facing this issue still. The one and only response that I get is this:

{params: {鈥, uri: null, error: null}
error: null
params:
+clicked_branch_link: false
+is_first_session: false
__proto__: Object
uri: null
__proto__: Object

@stefanlenoach @blastering66 @Jonovono I am facing a similar issue, did you finally manage to make it work?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Amurmurmur picture Amurmurmur  路  3Comments

Amurmurmur picture Amurmurmur  路  6Comments

maxs15 picture maxs15  路  7Comments

jandrell-formoso picture jandrell-formoso  路  4Comments

felixchan picture felixchan  路  5Comments