Skip to content

Commit 103cfb5

Browse files
authored
Merge pull request #706 from BranchMetrics/SDK-1440-update-dependencies
SDK-1440 update dependencies
2 parents d6688aa + c6fdb7f commit 103cfb5

File tree

7 files changed

+54
-33
lines changed

7 files changed

+54
-33
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
5.1.0 May 27, 2022
2+
* Update iOS SDK to 1.42.0
3+
* Update Android SDK to 5.1.5
4+
* Update 3rd party dependencies. Of note the plist vulnerability. (Thanks Sujay-shetty)
5+
* Replace setDebug with setLogging and test devices. https://help.branch.io/using-branch/docs/adding-test-devices
6+
7+
5.0.2 February 9, 2022
8+
* Update dependencies to latest non-breaking versions, of note the shelljs vulnerability. (Thanks again Sujay-shetty!)
9+
110
5.0.1 February 8, 2022
211
* Remove request package (thanks for catching Sujay-shetty)
312

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "branch-cordova-sdk",
33
"description": "Branch Metrics Cordova SDK",
44
"main": "src/index.js",
5-
"version": "5.0.2",
5+
"version": "5.1.0",
66
"homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking",
77
"repository": {
88
"type": "git",
@@ -55,23 +55,23 @@
5555
]
5656
},
5757
"dependencies": {
58-
"fs": "0.0.1-security",
59-
"glob": "^7.2.0",
58+
"glob": "^8.0.3",
6059
"mkpath": "^1.0.0",
6160
"node-version-compare": "^1.0.3",
62-
"plist": "^3.0.4",
61+
"plist": "^3.0.5",
6362
"shelljs": "^0.8.5",
64-
"xcode": "^2.1.0",
63+
"xcode": "^3.0.1",
6564
"xml2js": "^0.4.23"
6665
},
6766
"devDependencies": {
68-
"@commitlint/cli": "^8.3.5",
69-
"@commitlint/config-conventional": "^8.3.4",
70-
"eslint": "^6.8.0",
71-
"eslint-config-airbnb-base": "^14.2.1",
72-
"eslint-plugin-import": "^2.25.2",
73-
"husky": "^4.3.8",
74-
"lint-staged": "^10.5.4",
75-
"prettier": "^2.5.1"
67+
"fs": "0.0.1-security",
68+
"@commitlint/cli": "^17.0.1",
69+
"@commitlint/config-conventional": "^17.0.0",
70+
"eslint": "^8.16.0",
71+
"eslint-config-airbnb-base": "^15.0.0",
72+
"eslint-plugin-import": "^2.26.0",
73+
"husky": "^8.0.1",
74+
"lint-staged": "^12.4.2",
75+
"prettier": "^2.6.2"
7676
}
7777
}

plugin.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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="5.0.2">
27+
version="5.1.0">
2828

2929
<!-- Description -->
3030
<name>branch-cordova-sdk</name>
@@ -63,7 +63,7 @@ SOFTWARE.
6363
<!-- Manifest configuration is done via a js script. We should move it to this config in the future. -->
6464

6565
<source-file src="src/android/io/branch/BranchSDK.java" target-dir="src/io/branch" />
66-
<framework src="io.branch.sdk.android:library:5.0.15"/>
66+
<framework src="io.branch.sdk.android:library:5.1.5"/>
6767
</platform>
6868

6969
<!-- iOS -->
@@ -87,7 +87,7 @@ SOFTWARE.
8787
<source url="https://cdn.cocoapods.org/"/>
8888
</config>
8989
<pods>
90-
<pod name="Branch" spec="~> 1.40.2" />
90+
<pod name="Branch" spec="~> 1.42.0" />
9191
</pods>
9292
</podspec>
9393
</platform>

src/android/io/branch/BranchSDK.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
115115

116116
Runnable r = new RunnableThread(action, args, callbackContext);
117117

118-
if (action.equals("setDebug")) {
118+
if (action.equals("setLogging")) {
119119
cordova.getActivity().runOnUiThread(r);
120120
return true;
121121
} else if (action.equals("setCookieBasedMatching")) {
@@ -527,15 +527,19 @@ private void setCookieBasedMatching(String linkDomain, CallbackContext callbackC
527527
}
528528

529529
/**
530-
* <p>Sets the library to function in debug mode, enabling logging of all requests.</p>
531-
* <p>If you want to flag debug, call this <b>before</b> initUserSession</p>
530+
* <p>Enabling Branch SDK logging</p>
532531
*
533-
* @param isEnable A {@link Boolean} value to enable/disable debugging mode for the app.
532+
* @param isEnable A {@link Boolean} value to enable/disable logging
534533
* @param callbackContext A callback to execute at the end of this method
535534
*/
536-
private void setDebug(boolean isEnable, CallbackContext callbackContext) {
535+
private void setLogging(boolean isEnable, CallbackContext callbackContext) {
537536
this.activity = this.cordova.getActivity();
538-
Branch.enableDebugMode();
537+
if (isEnable == true) {
538+
Branch.enableLogging();
539+
} else {
540+
Branch.disableLogging();
541+
}
542+
539543
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, isEnable));
540544
}
541545

@@ -1154,8 +1158,8 @@ public void run() {
11541158
try {
11551159
Log.d(LCAT, "Runnable: " + this.action);
11561160

1157-
if (this.action.equals("setDebug")) {
1158-
setDebug(this.args.getBoolean(0), this.callbackContext);
1161+
if (this.action.equals("setLogging")) {
1162+
setLogging(this.args.getBoolean(0), this.callbackContext);
11591163
} else if (this.action.equals("setCookieBasedMatching")) {
11601164
setCookieBasedMatching(this.args.getString(0), this.callbackContext);
11611165
} else if (this.action.equals("disableTracking")) {

src/index.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const standardEvent = {
3434

3535
// Branch prototype
3636
var Branch = function Branch() {
37-
this.debugMode = false;
37+
this.enableLogging = false;
3838
this.trackingDisabled = false;
3939
this.sessionInitialized = false;
4040
};
@@ -113,11 +113,19 @@ Branch.prototype.setRequestMetadata = function setRequestMetadata(key, val) {
113113
return execute("setRequestMetadata", [key, val]);
114114
};
115115

116+
// Deprecated. Replaced by setLogging(isEnabled) and test devices. https://help.branch.io/using-branch/docs/adding-test-devices
116117
Branch.prototype.setDebug = function setDebug(isEnabled) {
118+
return new Promise(function promise(resolve, reject) {
119+
resolve(false);
120+
});
121+
};
122+
123+
// For early lifecycle logging, we recommend you enable logging in the native iOS or Android code.
124+
Branch.prototype.setLogging = function setLogging(isEnabled) {
117125
var value = typeof isEnabled !== "boolean" ? false : isEnabled;
118-
this.debugMode = value;
126+
this.enableLogging = value;
119127

120-
return execute("setDebug", [value]);
128+
return execute("enableLogging", [value]);
121129
};
122130

123131
Branch.prototype.setCookieBasedMatching = function setCookieBasedMatching(

src/ios/BranchSDK.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
- (void)enableTestMode:(CDVInvokedUrlCommand*)command;
3030
- (void)initSession:(CDVInvokedUrlCommand*)command;
3131
- (void)disableTracking:(CDVInvokedUrlCommand*)command;
32-
- (void)setDebug:(CDVInvokedUrlCommand*)command;
32+
- (void)enableLogging:(CDVInvokedUrlCommand*)command;
3333
- (void)getAutoInstance:(CDVInvokedUrlCommand*)command;
3434
- (void)getLatestReferringParams:(CDVInvokedUrlCommand*)command;
3535
- (void)getFirstReferringParams:(CDVInvokedUrlCommand*)command;

src/ios/BranchSDK.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,14 @@ - (void)disableTracking:(CDVInvokedUrlCommand*)command
153153
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
154154
}
155155

156-
- (void)setDebug:(CDVInvokedUrlCommand*)command
156+
- (void)enableLogging:(CDVInvokedUrlCommand*)command
157157
{
158-
bool enableDebug = [[command.arguments objectAtIndex:0] boolValue];
159-
if (enableDebug) {
160-
[[Branch getInstance] setDebug];
158+
bool enableLogging = [[command.arguments objectAtIndex:0] boolValue];
159+
if (enableLogging) {
160+
[[Branch getInstance] enableLogging];
161161
}
162162

163-
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:enableDebug];
163+
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:enableLogging];
164164

165165
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
166166
}

0 commit comments

Comments
 (0)