Skip to content

Commit 4fbf059

Browse files
committed
SDK-1440 fix logging method, update iOS SDK
1 parent cbb06db commit 4fbf059

File tree

6 files changed

+26
-14
lines changed

6 files changed

+26
-14
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.4
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"xml2js": "^0.4.23"
6565
},
6666
"devDependencies": {
67+
"fs": "0.0.1-security",
6768
"@commitlint/cli": "^17.0.1",
6869
"@commitlint/config-conventional": "^17.0.0",
6970
"eslint": "^8.16.0",

plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ SOFTWARE.
8787
<source url="https://cdn.cocoapods.org/"/>
8888
</config>
8989
<pods>
90-
<pod name="Branch" spec="~> 1.41.0" />
90+
<pod name="Branch" spec="~> 1.42.0" />
9191
</pods>
9292
</podspec>
9393
</platform>

src/index.js

Lines changed: 10 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,18 @@ 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+
Branch.prototype.setLogging = function setLogging(isEnabled) {
117124
var value = typeof isEnabled !== "boolean" ? false : isEnabled;
118-
this.debugMode = value;
125+
this.enableLogging = value;
119126

120-
return execute("setDebug", [value]);
127+
return execute("enableLogging", [value]);
121128
};
122129

123130
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: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ - (void)continueUserActivity:(CDVInvokedUrlCommand*)command
8686
#pragma mark - Public APIs
8787
#pragma mark - Branch Basic Methods
8888

89-
- (void)enableTestMode:(CDVInvokedUrlCommand*)command
90-
{
91-
[Branch setUseTestBranchKey:TRUE];
92-
}
93-
9489
- (void)initSession:(CDVInvokedUrlCommand*)command
9590
{
9691
[[Branch getInstance] registerPluginName:@"CordovaIonic" version:pluginVersion];
@@ -153,11 +148,11 @@ - (void)disableTracking:(CDVInvokedUrlCommand*)command
153148
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
154149
}
155150

156-
- (void)setDebug:(CDVInvokedUrlCommand*)command
151+
- (void)enableLogging:(CDVInvokedUrlCommand*)command
157152
{
158-
bool enableDebug = [[command.arguments objectAtIndex:0] boolValue];
159-
if (enableDebug) {
160-
[[Branch getInstance] setDebug];
153+
bool enableLogging = [[command.arguments objectAtIndex:0] boolValue];
154+
if (enableLogging) {
155+
[[Branch getInstance] enableLogging];
161156
}
162157

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

0 commit comments

Comments
 (0)