Skip to content

Commit

Permalink
fix: updated js from js.es6 to js
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Nov 16, 2016
1 parent bb858e4 commit d3ba77b
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 67 deletions.
30 changes: 14 additions & 16 deletions testbed/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,12 @@ var app = {
app.initialize();

// branch
function DeepLinkHandler(data) {
console.log('Trigger DeepLinkHandler()');

function onBranchLinkHook(data) {
if (data) {
console.log(data);
alert('Data Link handler response: ' + JSON.stringify(data));
alert('Initialize: ' + JSON.stringify(data));
}
}

function NonBranchLinkHandler(data) {
console.log('Trigger NonBranchLinkHandler()');

if (data) {
console.log(data);
alert('Non-branch link found: ' + JSON.stringify(data));
else {
alert('No data found');
}
}

Expand All @@ -45,10 +36,17 @@ function BranchInit(isDebug) {
// sync with mixpanel if installed
Branch.setMixpanelToken('your_mixpanel_token');
// init
Branch.initSession().then(function (res) {
Branch.initSession(onBranchLinkHook).then(function(res) {
console.log(res);
}).catch(function (err) {
alert('Response: ' + JSON.stringify(res));
}).catch(function(err) {
console.error(err);
alert('Error: ' + JSON.stringify(err));
});
Branch.onNonBranchLink(function NonBranchLinkHandler(data) {
if (data) {
alert('Non-branch link found: ' + JSON.stringify(data));
}
});
}

Expand Down Expand Up @@ -311,4 +309,4 @@ function BranchReferralsHistory() {
console.error(err);
alert('Error: ' + JSON.stringify(err));
});
}
}
Loading

0 comments on commit d3ba77b

Please sign in to comment.