File tree Expand file tree Collapse file tree 4 files changed +9
-12
lines changed Expand file tree Collapse file tree 4 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " branch-cordova-sdk" ,
3
3
"description" : " Branch Metrics Cordova SDK" ,
4
4
"main" : " src/branch.js" ,
5
- "version" : " 2.6.9 " ,
5
+ "version" : " 2.6.10 " ,
6
6
"homepage" : " https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking" ,
7
7
"repository" : {
8
8
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ SOFTWARE.
24
24
<plugin xmlns =" http://apache.org/cordova/ns/plugins/1.0"
25
25
xmlns : android =" http://schemas.android.com/apk/res/android"
26
26
id =" branch-cordova-sdk"
27
- version =" 2.6.9 " >
27
+ version =" 2.6.10 " >
28
28
29
29
<!-- DO NOT EDIT THIS FILE. MAKE ALL CHANGES TO plugin.template.xml INSTEAD -->
30
30
@@ -78,7 +78,6 @@ SOFTWARE.
78
78
<framework src =" iAd.framework" />
79
79
<framework src =" SafariServices.framework" />
80
80
<framework src =" AdSupport.framework" />
81
- <framework src =" CoreTelephony.framework" />
82
81
<framework src =" CoreSpotlight.framework" />
83
82
<framework src =" MobileCoreServices.framework" />
84
83
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ SOFTWARE.
24
24
<plugin xmlns =" http://apache.org/cordova/ns/plugins/1.0"
25
25
xmlns : android =" http://schemas.android.com/apk/res/android"
26
26
id =" branch-cordova-sdk"
27
- version =" 2.6.9 " >
27
+ version =" 2.6.10 " >
28
28
29
29
<!-- DO NOT EDIT THIS FILE. MAKE ALL CHANGES TO plugin.template.xml INSTEAD -->
30
30
@@ -78,7 +78,6 @@ SOFTWARE.
78
78
<framework src =" iAd.framework" />
79
79
<framework src =" SafariServices.framework" />
80
80
<framework src =" AdSupport.framework" />
81
- <framework src =" CoreTelephony.framework" />
82
81
<framework src =" CoreSpotlight.framework" />
83
82
<framework src =" MobileCoreServices.framework" />
84
83
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