Skip to content

Commit

Permalink
docs: fixed branch init being called twice because of premissions
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Aug 25, 2017
1 parent 9a58cb3 commit c1a54e6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@
},
branchInit: function() {
// Branch initialization
Branch.initSession(function(data) {
if (data['+clicked_branch_link']) {
// read deep link data on click
alert('Deep Link Data: ' + JSON.stringify(data));
console.log('Trigger DeepLinkHandler()')
alert('Deep Link Data: ' + JSON.stringify(data))
});
}
};
Expand Down Expand Up @@ -159,8 +160,10 @@
function branchInit() {
// Branch initialization
Branch.initSession(function(data) {
// read deep link data on click
alert('Deep Link Data: ' + JSON.stringify(data));
if (data['+clicked_branch_link']) {
// read deep link data on click
alert('Deep Link Data: ' + JSON.stringify(data));
}
});
}
});
Expand Down Expand Up @@ -202,8 +205,10 @@
// only on devices
if (!platform.is('cordova')) { return }
Branch.initSession(data => {
// read deep link data on click
alert('Deep Link Data: ' + JSON.stringify(data));
if (data['+clicked_branch_link']) {
// read deep link data on click
alert('Deep Link Data: ' + JSON.stringify(data));
}
});
}
}
Expand Down Expand Up @@ -256,8 +261,10 @@

// Branch initialization
Branch.initSession(function(data) {
// read deep link data on click
alert('Deep Link Data: ' + JSON.stringify(data))
if (data['+clicked_branch_link']) {
// read deep link data on click
alert('Deep Link Data: ' + JSON.stringify(data))
}
}).then(function(res) {
alert('Response: ' + JSON.stringify(res))
}).catch(function(err) {
Expand Down Expand Up @@ -401,8 +408,10 @@
```js
// Branch initialization within your deviceready and resume
Branch.initSession(function(deepLinkData) {
// handler for deep link data on click
alert('Response: ' + JSON.stringify(deepLinkData))
if (data['+clicked_branch_link']) {
// handler for deep link data on click
alert('Response: ' + JSON.stringify(deepLinkData))
}
})
```

Expand Down
8 changes: 5 additions & 3 deletions testbed/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ function BranchInit (isDebug) {

// Branch initialization
Branch.initSession(function (data) {
// read deep link data on click
console.log('Trigger DeepLinkHandler()')
alert('Deep Link Data: ' + JSON.stringify(data))
if (data['+clicked_branch_link']) {
// read deep link data on click
console.log('Trigger DeepLinkHandler()')
alert('Deep Link Data: ' + JSON.stringify(data))
}
}).then(function (res) {
console.log(res)
}).catch(function (err) {
Expand Down

0 comments on commit c1a54e6

Please sign in to comment.