File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,21 @@ Branch.prototype.disableGlobalListenersWarnings = function () {
37
37
38
38
Branch . prototype . initSession = function ( deepLinkDataListener ) {
39
39
// private method to filter out +clicked_branch_link = false in deep link callback
40
+ var previous = ''
40
41
var deepLinkDataParser = function ( deepLinkData ) {
41
42
var isBranchLink = '+clicked_branch_link'
42
43
var isNonBranchLink = '+non_branch_link'
44
+ // TODO: figure out why iOS SDK passes data twice on Ionic 2 terminated and no network connection
45
+ var isNewData = JSON . stringify ( deepLinkData ) !== previous
46
+ var isBranchLinkClick = deepLinkData . hasOwnProperty ( isBranchLink ) && deepLinkData [ isBranchLink ] === true
47
+ var isNonBranchLinkClick = deepLinkData . hasOwnProperty ( isNonBranchLink )
43
48
44
- // +clicked_branch_link' = true || +non_branch_link
45
- if ( ( deepLinkData . hasOwnProperty ( isBranchLink ) && deepLinkData [ isBranchLink ] === true ) || ( deepLinkData . hasOwnProperty ( isNonBranchLink ) ) ) {
49
+ // is +clicked_branch_link' = true || +non_branch_link
50
+ if ( isNewData && ( isBranchLinkClick || isNonBranchLinkClick ) ) {
46
51
// to Branch.initSession(function(data) {})
47
52
deepLinkDataListener ( deepLinkData )
48
53
}
54
+ previous = JSON . stringify ( deepLinkData )
49
55
}
50
56
51
57
if ( ! disableGlobalListenersWarnings && ! deepLinkDataListener && ! window . DeepLinkHandler ) {
You can’t perform that action at this time.
0 commit comments