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 22 "name" : " branch-cordova-sdk" ,
33 "description" : " Branch Metrics Cordova SDK" ,
44 "main" : " src/branch.js" ,
5- "version" : " 2.6.9 " ,
5+ "version" : " 2.6.10 " ,
66 "homepage" : " https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking" ,
77 "repository" : {
88 "type" : " git" ,
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ SOFTWARE.
2424<plugin xmlns =" http://apache.org/cordova/ns/plugins/1.0"
2525 xmlns : android =" http://schemas.android.com/apk/res/android"
2626 id =" branch-cordova-sdk"
27- version =" 2.6.9 " >
27+ version =" 2.6.10 " >
2828
2929 <!-- DO NOT EDIT THIS FILE. MAKE ALL CHANGES TO plugin.template.xml INSTEAD -->
3030
@@ -78,7 +78,6 @@ SOFTWARE.
7878 <framework src =" iAd.framework" />
7979 <framework src =" SafariServices.framework" />
8080 <framework src =" AdSupport.framework" />
81- <framework src =" CoreTelephony.framework" />
8281 <framework src =" CoreSpotlight.framework" />
8382 <framework src =" MobileCoreServices.framework" />
8483
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ SOFTWARE.
2424<plugin xmlns =" http://apache.org/cordova/ns/plugins/1.0"
2525 xmlns : android =" http://schemas.android.com/apk/res/android"
2626 id =" branch-cordova-sdk"
27- version =" 2.6.9 " >
27+ version =" 2.6.10 " >
2828
2929 <!-- DO NOT EDIT THIS FILE. MAKE ALL CHANGES TO plugin.template.xml INSTEAD -->
3030
@@ -78,7 +78,6 @@ SOFTWARE.
7878 <framework src =" iAd.framework" />
7979 <framework src =" SafariServices.framework" />
8080 <framework src =" AdSupport.framework" />
81- <framework src =" CoreTelephony.framework" />
8281 <framework src =" CoreSpotlight.framework" />
8382 <framework src =" MobileCoreServices.framework" />
8483
Original file line number Diff line number Diff line change @@ -35,24 +35,23 @@ Branch.prototype.disableGlobalListenersWarnings = function () {
3535 disableGlobalListenersWarnings = true
3636}
3737
38+ var runOnce = true
3839Branch . prototype . initSession = function ( deepLinkDataListener ) {
40+ // handle double init from onResume on iOS
41+ if ( ! runOnce ) return
42+ runOnce = ( deviceVendor . indexOf ( 'Apple' ) < 0 )
43+
3944 // private method to filter out +clicked_branch_link = false in deep link callback
40- var previous = 0
4145 var deepLinkDataParser = function ( deepLinkData ) {
4246 var isBranchLink = '+clicked_branch_link'
4347 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
4748 var isBranchLinkClick = deepLinkData . hasOwnProperty ( isBranchLink ) && deepLinkData [ isBranchLink ] === true
4849 var isNonBranchLinkClick = deepLinkData . hasOwnProperty ( isNonBranchLink )
4950
5051 // is +clicked_branch_link' = true || +non_branch_link
51- if ( isNewData && ( isBranchLinkClick || isNonBranchLinkClick ) ) {
52- // to Branch.initSession(function(data) {})
52+ if ( isBranchLinkClick || isNonBranchLinkClick ) {
5353 deepLinkDataListener ( deepLinkData )
5454 }
55- previous = dataLength
5655 }
5756
5857 if ( ! disableGlobalListenersWarnings && ! deepLinkDataListener && ! window . DeepLinkHandler ) {
You can’t perform that action at this time.
0 commit comments