Skip to content

Commit 0f18e39

Browse files
author
Aaron Lopez
authored
Merge pull request #504 from BranchMetrics/upgrade
Upgrade to Android SDK 2.19.4 & 0.25.5
2 parents 1eb490e + bc7d41d commit 0f18e39

35 files changed

+413
-239
lines changed

plugin.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ SOFTWARE.
137137
<source-file src="src/ios/dependencies/Branch-SDK/BNCStrongMatchHelper.m" />
138138
<header-file src="src/ios/dependencies/Branch-SDK/BNCSystemObserver.h" />
139139
<source-file src="src/ios/dependencies/Branch-SDK/BNCSystemObserver.m" />
140+
<header-file src="src/ios/dependencies/Branch-SDK/BNCThreads.h" />
141+
<source-file src="src/ios/dependencies/Branch-SDK/BNCThreads.m" />
140142
<header-file src="src/ios/dependencies/Branch-SDK/BNCURLBlackList.h" />
141143
<source-file src="src/ios/dependencies/Branch-SDK/BNCURLBlackList.m" />
142144
<header-file src="src/ios/dependencies/Branch-SDK/Branch+Validator.h" />

src/android/dependencies/Branch.jar

18.5 KB
Binary file not shown.

src/ios/dependencies/Branch-SDK/BNCApplication.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@
4949
/// Returns a dictionary of device / identity pairs.
5050
@property (atomic, readonly) NSDictionary<NSString*, NSString*>*_Nonnull deviceKeyIdentityValueDictionary;
5151

52+
/// The team identifier for the app.
53+
@property (atomic, readonly) NSString*_Nullable teamID;
5254
@end

src/ios/dependencies/Branch-SDK/BNCApplication.m

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ + (BNCApplication*) createCurrentApplication {
4848
application->_firstInstallDate = [BNCApplication firstInstallDate];
4949
application->_currentInstallDate = [BNCApplication currentInstallDate];
5050

51+
NSString*group = [BNCKeyChain securityAccessGroup];
52+
if (group) {
53+
NSRange range = [group rangeOfString:@"."];
54+
if (range.location != NSNotFound) {
55+
application->_teamID = [[group substringToIndex:range.location] copy];
56+
}
57+
}
58+
5159
return application;
5260
}
5361

@@ -93,7 +101,7 @@ + (NSDate*) firstInstallBuildDate {
93101
forService:kBranchKeychainService
94102
key:kBranchKeychainFirstBuildKey
95103
cloudAccessGroup:nil];
96-
104+
if (error) BNCLogError(@"Keychain store: %@.", error);
97105
return firstBuildDate;
98106
}
99107

@@ -128,7 +136,7 @@ + (NSDate*) firstInstallDate {
128136
forService:kBranchKeychainService
129137
key:kBranchKeychainFirstInstalldKey
130138
cloudAccessGroup:nil];
131-
139+
if (error) BNCLogError(@"Keychain store: %@.", error);
132140
return firstInstallDate;
133141
}
134142

@@ -146,3 +154,16 @@ - (NSDictionary*) deviceKeyIdentityValueDictionary {
146154
}
147155

148156
@end
157+
158+
@implementation BNCApplication (BNCTest)
159+
160+
- (void) setAppOriginalInstallDate:(NSDate*)originalInstallDate
161+
firstInstallDate:(NSDate*)firstInstallDate
162+
lastUpdateDate:(NSDate*)lastUpdateDate {
163+
self->_currentInstallDate = firstInstallDate; // latest_install_time
164+
self->_firstInstallDate = originalInstallDate; // first_install_time
165+
self->_currentBuildDate = lastUpdateDate; // lastest_update_time
166+
}
167+
168+
@end
169+

src/ios/dependencies/Branch-SDK/BNCCommerceEvent.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ - (void)makeRequest:(BNCServerInterface *)serverInterface
578578
if (self.commerceDictionary)
579579
params[@"commerce_data"] = self.commerceDictionary;
580580
if (preferenceHelper.limitFacebookTracking)
581-
params[@"limit_facebook_tracking"] = CFBridgingRelease(kCFBooleanTrue);
581+
params[@"limit_facebook_tracking"] = (__bridge NSNumber*) kCFBooleanTrue;
582582

583583
NSString *URL = [preferenceHelper getAPIURL:BRANCH_REQUEST_ENDPOINT_USER_COMPLETED_ACTION];
584584
[serverInterface postRequest:params

src/ios/dependencies/Branch-SDK/BNCConfig.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
BOOL const BNC_API_PINNED = YES;
1313
NSString * const BNC_API_VERSION = @"v1";
1414
NSString * const BNC_LINK_URL = @"https://bnc.lt";
15-
NSString * const BNC_SDK_VERSION = @"0.24.2";
15+
NSString * const BNC_SDK_VERSION = @"0.25.5";

src/ios/dependencies/Branch-SDK/BNCDebug.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ BOOL BNCDebuggerIsAttached() {
9393

9494
uint count = 0;
9595
Ivar *ivars = class_copyIvarList(class, &count);
96-
for (uint i = 0; i < count; ++i) {
96+
for (uint i = 0; ivars && i < count; ++i) {
9797
const char* encoding = ivar_getTypeEncoding(ivars[i]);
9898
const char* ivarName = ivar_getName(ivars[i]);
9999
const void* ivarPtr = nil;
@@ -174,7 +174,7 @@ BOOL BNCDebuggerIsAttached() {
174174

175175
count = 0;
176176
objc_property_t *properties = class_copyPropertyList(class, &count);
177-
for (int i = 0; i < count; ++i)
177+
for (int i = 0; properties && i < count; ++i)
178178
[result appendFormat:@"\tProperty name: '%s'.\n", property_getName(properties[i])];
179179
if (properties) free(properties);
180180

src/ios/dependencies/Branch-SDK/BNCDeviceInfo.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,11 @@ - (NSDictionary*) v2dictionary {
430430
addString(osVersion, os_version);
431431
addString(extensionType, environment);
432432
addString(vendorId, idfv);
433-
addString(adId, idfa);
433+
if ([BNCPreferenceHelper preferenceHelper].isDebug) {
434+
dictionary[@"unidentified_device"] = (__bridge NSNumber*) kCFBooleanTrue;
435+
} else {
436+
addString(adId, idfa);
437+
}
434438
addString(browserUserAgent, user_agent);
435439
addString(country, country);
436440
addString(language, language);
@@ -446,7 +450,7 @@ - (NSDictionary*) v2dictionary {
446450
#include "BNCFieldDefines.h"
447451

448452
if (!self.isAdTrackingEnabled)
449-
dictionary[@"limit_ad_tracking"] = CFBridgingRelease(kCFBooleanTrue);
453+
dictionary[@"limit_ad_tracking"] = (__bridge NSNumber*) kCFBooleanTrue;
450454

451455
NSString *s = nil;
452456
BNCPreferenceHelper *preferences = [BNCPreferenceHelper preferenceHelper];
@@ -458,7 +462,7 @@ - (NSDictionary*) v2dictionary {
458462
if (s.length) dictionary[@"device_fingerprint_id"] = s;
459463

460464
if (preferences.limitFacebookTracking)
461-
dictionary[@"limit_facebook_tracking"] = CFBridgingRelease(kCFBooleanTrue);
465+
dictionary[@"limit_facebook_tracking"] = (__bridge NSNumber*) kCFBooleanTrue;
462466

463467
dictionary[@"sdk"] = @"ios";
464468
dictionary[@"sdk_version"] = BNC_SDK_VERSION;

src/ios/dependencies/Branch-SDK/BNCEncodingUtils.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ + (NSData *) dataFromHexString:(NSString*)string {
439439
int highValue = -1;
440440
const uint8_t *p = (const uint8_t*) [inputData bytes];
441441
for (NSUInteger i = 0; i < inputData.length; ++i) {
442-
int value = -1;
442+
int value;
443443
if (*p >= '0' && *p <= '9')
444444
value = *p - '0';
445445
else

src/ios/dependencies/Branch-SDK/BNCError.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
//
2-
// BNCError.h
3-
// Branch-SDK
4-
//
5-
// Created by Qinwei Gong on 11/17/14.
6-
// Copyright (c) 2014 Branch Metrics. All rights reserved.
7-
//
1+
/**
2+
@file BNCError.h
3+
@package Branch-SDK
4+
@brief Branch errors.
5+
6+
@author Qinwei Gong
7+
@date November 2014
8+
@copyright Copyright © 2014 Branch. All rights reserved.
9+
*/
810

911
#if __has_feature(modules)
1012
@import Foundation;
@@ -40,4 +42,5 @@ typedef NS_ENUM(NSInteger, BNCErrorCode) {
4042
+ (NSError*_Nonnull) branchErrorWithCode:(BNCErrorCode)errorCode localizedMessage:(NSString*_Nullable)message;
4143
@end
4244

43-
void BNCForceNSErrorCategoryToLoad(void) __attribute__((constructor));
45+
void BNCForceNSErrorCategoryToLoad(void)
46+
__attribute__((constructor));

0 commit comments

Comments
 (0)