Skip to content

Commit b3593e2

Browse files
committed
fix: updated onDeviceResume method calls in testbed
tested √
1 parent c69ef56 commit b3593e2

File tree

2 files changed

+18
-54
lines changed

2 files changed

+18
-54
lines changed

testbed/www/js.es6/index.js

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
'use strict';
2-
31
// app
4-
52
var app = {
63
initialize: function() {
74
this.bindEvents();
@@ -11,51 +8,35 @@ var app = {
118
document.addEventListener('resume', this.onDeviceReady, false);
129
},
1310
onDeviceReady: function() {
14-
app.branchInit();
11+
BranchInit(true);
1512
},
1613
onDeviceResume: function() {
17-
app.branchInit();
18-
},
19-
branchInit: function() {
20-
// Branch debug
21-
Branch.setDebug(true);
22-
23-
// Branch initialization
24-
Branch.initSession(function(data) {
25-
// read deep link data on click
26-
alert('Deep Link Data: ' + JSON.stringify(data));
27-
});
14+
BranchInit(true);
2815
}
2916
};
3017
app.initialize();
3118

3219
// branch
33-
3420
function BranchInit(isDebug) {
3521
console.log('Trigger BranchInit()');
3622

3723
// for development and debugging only
3824
Branch.setDebug(isDebug);
3925

40-
// sync with mixpanel if installed
26+
// sync with Mixpanel if installed
4127
Branch.setMixpanelToken('your_mixpanel_token');
4228

43-
// init
44-
Branch.initSession(BranchLinkData).then(function(res) {
29+
// Branch initialization
30+
Branch.initSession(function(data) {
31+
// read deep link data on click
32+
console.log('Trigger DeepLinkHandler()');
33+
alert('Deep Link Data: ' + JSON.stringify(data));
34+
}).then(function(res) {
4535
console.log(res);
4636
}).catch(function(err) {
4737
console.error(err);
4838
});
4939

50-
// handler for deep link data
51-
function BranchLinkData(data) {
52-
console.log('Trigger BranchLinkData()');
53-
54-
if (data) {
55-
alert(JSON.stringify(data));
56-
}
57-
}
58-
5940
// optional
6041
Branch.onNonBranchLink(function NonBranchLinkHandler(data) {
6142
console.log('Trigger NonBranchLinkData()');

testbed/www/js/index.js

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
// app
4-
54
var app = {
65
initialize: function initialize() {
76
this.bindEvents();
@@ -11,51 +10,35 @@ var app = {
1110
document.addEventListener('resume', this.onDeviceReady, false);
1211
},
1312
onDeviceReady: function onDeviceReady() {
14-
app.branchInit();
13+
BranchInit(true);
1514
},
1615
onDeviceResume: function onDeviceResume() {
17-
app.branchInit();
18-
},
19-
branchInit: function branchInit() {
20-
// Branch debug
21-
Branch.setDebug(true);
22-
23-
// Branch initialization
24-
Branch.initSession(function (data) {
25-
// read deep link data on click
26-
alert('Deep Link Data: ' + JSON.stringify(data));
27-
});
16+
BranchInit(true);
2817
}
2918
};
3019
app.initialize();
3120

3221
// branch
33-
3422
function BranchInit(isDebug) {
3523
console.log('Trigger BranchInit()');
3624

3725
// for development and debugging only
3826
Branch.setDebug(isDebug);
3927

40-
// sync with mixpanel if installed
28+
// sync with Mixpanel if installed
4129
Branch.setMixpanelToken('your_mixpanel_token');
4230

43-
// init
44-
Branch.initSession(BranchLinkData).then(function (res) {
31+
// Branch initialization
32+
Branch.initSession(function (data) {
33+
// read deep link data on click
34+
console.log('Trigger DeepLinkHandler()');
35+
alert('Deep Link Data: ' + JSON.stringify(data));
36+
}).then(function (res) {
4537
console.log(res);
4638
}).catch(function (err) {
4739
console.error(err);
4840
});
4941

50-
// handler for deep link data
51-
function BranchLinkData(data) {
52-
console.log('Trigger BranchLinkData()');
53-
54-
if (data) {
55-
alert(JSON.stringify(data));
56-
}
57-
}
58-
5942
// optional
6043
Branch.onNonBranchLink(function NonBranchLinkHandler(data) {
6144
console.log('Trigger NonBranchLinkData()');

0 commit comments

Comments
 (0)