File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -35,24 +35,23 @@ Branch.prototype.disableGlobalListenersWarnings = function () {
35
35
disableGlobalListenersWarnings = true
36
36
}
37
37
38
+ var runOnce = true
38
39
Branch . prototype . initSession = function ( deepLinkDataListener ) {
40
+ // handle double init from onResume on iOS
41
+ if ( ! runOnce ) return
42
+ runOnce = ( deviceVendor . indexOf ( 'Apple' ) < 0 )
43
+
39
44
// private method to filter out +clicked_branch_link = false in deep link callback
40
- var previous = 0
41
45
var deepLinkDataParser = function ( deepLinkData ) {
42
46
var isBranchLink = '+clicked_branch_link'
43
47
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 dataLength = JSON . stringify ( deepLinkData ) . length
46
- var isNewData = dataLength !== previous
47
48
var isBranchLinkClick = deepLinkData . hasOwnProperty ( isBranchLink ) && deepLinkData [ isBranchLink ] === true
48
49
var isNonBranchLinkClick = deepLinkData . hasOwnProperty ( isNonBranchLink )
49
50
50
51
// is +clicked_branch_link' = true || +non_branch_link
51
- if ( isNewData && ( isBranchLinkClick || isNonBranchLinkClick ) ) {
52
- // to Branch.initSession(function(data) {})
52
+ if ( isBranchLinkClick || isNonBranchLinkClick ) {
53
53
deepLinkDataListener ( deepLinkData )
54
54
}
55
- previous = dataLength
56
55
}
57
56
58
57
if ( ! disableGlobalListenersWarnings && ! deepLinkDataListener && ! window . DeepLinkHandler ) {
You can’t perform that action at this time.
0 commit comments