Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK-1440 update dependencies #706

Merged
merged 7 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
5.1.0 May 27, 2022
* Update iOS SDK to 1.42.0
* Update Android SDK to 5.1.5
* Update 3rd party dependencies. Of note the plist vulnerability. (Thanks Sujay-shetty)
* Replace setDebug with setLogging and test devices. https://help.branch.io/using-branch/docs/adding-test-devices

5.0.2 February 9, 2022
* Update dependencies to latest non-breaking versions, of note the shelljs vulnerability. (Thanks again Sujay-shetty!)

5.0.1 February 8, 2022
* Remove request package (thanks for catching Sujay-shetty)

Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "branch-cordova-sdk",
"description": "Branch Metrics Cordova SDK",
"main": "src/index.js",
"version": "5.0.2",
"version": "5.1.0",
"homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking",
"repository": {
"type": "git",
Expand Down Expand Up @@ -55,23 +55,23 @@
]
},
"dependencies": {
"fs": "0.0.1-security",
"glob": "^7.2.0",
"glob": "^8.0.3",
"mkpath": "^1.0.0",
"node-version-compare": "^1.0.3",
"plist": "^3.0.4",
"plist": "^3.0.5",
"shelljs": "^0.8.5",
"xcode": "^2.1.0",
"xcode": "^3.0.1",
"xml2js": "^0.4.23"
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.25.2",
"husky": "^4.3.8",
"lint-staged": "^10.5.4",
"prettier": "^2.5.1"
"fs": "0.0.1-security",
"@commitlint/cli": "^17.0.1",
"@commitlint/config-conventional": "^17.0.0",
"eslint": "^8.16.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.26.0",
"husky": "^8.0.1",
"lint-staged": "^12.4.2",
"prettier": "^2.6.2"
}
}
6 changes: 3 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SOFTWARE.
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="branch-cordova-sdk"
version="5.0.2">
version="5.1.0">

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

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

<!-- iOS -->
Expand All @@ -87,7 +87,7 @@ SOFTWARE.
<source url="https://cdn.cocoapods.org/"/>
</config>
<pods>
<pod name="Branch" spec="~> 1.40.2" />
<pod name="Branch" spec="~> 1.42.0" />
</pods>
</podspec>
</platform>
Expand Down
20 changes: 12 additions & 8 deletions src/android/io/branch/BranchSDK.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo

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

if (action.equals("setDebug")) {
if (action.equals("setLogging")) {
cordova.getActivity().runOnUiThread(r);
return true;
} else if (action.equals("setCookieBasedMatching")) {
Expand Down Expand Up @@ -527,15 +527,19 @@ private void setCookieBasedMatching(String linkDomain, CallbackContext callbackC
}

/**
* <p>Sets the library to function in debug mode, enabling logging of all requests.</p>
* <p>If you want to flag debug, call this <b>before</b> initUserSession</p>
* <p>Enabling Branch SDK logging</p>
*
* @param isEnable A {@link Boolean} value to enable/disable debugging mode for the app.
* @param isEnable A {@link Boolean} value to enable/disable logging
* @param callbackContext A callback to execute at the end of this method
*/
private void setDebug(boolean isEnable, CallbackContext callbackContext) {
private void setLogging(boolean isEnable, CallbackContext callbackContext) {
this.activity = this.cordova.getActivity();
Branch.enableDebugMode();
if (isEnable == true) {
Branch.enableLogging();
} else {
Branch.disableLogging();
}

callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, isEnable));
}

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

if (this.action.equals("setDebug")) {
setDebug(this.args.getBoolean(0), this.callbackContext);
if (this.action.equals("setLogging")) {
setLogging(this.args.getBoolean(0), this.callbackContext);
} else if (this.action.equals("setCookieBasedMatching")) {
setCookieBasedMatching(this.args.getString(0), this.callbackContext);
} else if (this.action.equals("disableTracking")) {
Expand Down
14 changes: 11 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const standardEvent = {

// Branch prototype
var Branch = function Branch() {
this.debugMode = false;
this.enableLogging = false;
this.trackingDisabled = false;
this.sessionInitialized = false;
};
Expand Down Expand Up @@ -113,11 +113,19 @@ Branch.prototype.setRequestMetadata = function setRequestMetadata(key, val) {
return execute("setRequestMetadata", [key, val]);
};

// Deprecated. Replaced by setLogging(isEnabled) and test devices. https://help.branch.io/using-branch/docs/adding-test-devices
Branch.prototype.setDebug = function setDebug(isEnabled) {
return new Promise(function promise(resolve, reject) {
resolve(false);
});
};

// For early lifecycle logging, we recommend you enable logging in the native iOS or Android code.
Branch.prototype.setLogging = function setLogging(isEnabled) {
var value = typeof isEnabled !== "boolean" ? false : isEnabled;
this.debugMode = value;
this.enableLogging = value;

return execute("setDebug", [value]);
return execute("enableLogging", [value]);
};

Branch.prototype.setCookieBasedMatching = function setCookieBasedMatching(
Expand Down
2 changes: 1 addition & 1 deletion src/ios/BranchSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
- (void)enableTestMode:(CDVInvokedUrlCommand*)command;
- (void)initSession:(CDVInvokedUrlCommand*)command;
- (void)disableTracking:(CDVInvokedUrlCommand*)command;
- (void)setDebug:(CDVInvokedUrlCommand*)command;
- (void)enableLogging:(CDVInvokedUrlCommand*)command;
- (void)getAutoInstance:(CDVInvokedUrlCommand*)command;
- (void)getLatestReferringParams:(CDVInvokedUrlCommand*)command;
- (void)getFirstReferringParams:(CDVInvokedUrlCommand*)command;
Expand Down
10 changes: 5 additions & 5 deletions src/ios/BranchSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ - (void)disableTracking:(CDVInvokedUrlCommand*)command
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

- (void)setDebug:(CDVInvokedUrlCommand*)command
- (void)enableLogging:(CDVInvokedUrlCommand*)command
{
bool enableDebug = [[command.arguments objectAtIndex:0] boolValue];
if (enableDebug) {
[[Branch getInstance] setDebug];
bool enableLogging = [[command.arguments objectAtIndex:0] boolValue];
if (enableLogging) {
[[Branch getInstance] enableLogging];
}

CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:enableDebug];
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:enableLogging];

[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
Expand Down