Skip to content

Commit 6a34f3e

Browse files
authored
Merge pull request #435 from BranchMetrics/deps
fix: updated dependencies
2 parents 75204c0 + e3c3876 commit 6a34f3e

35 files changed

+1360
-302
lines changed

package.json

Lines changed: 1 addition & 1 deletion
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/branch.js",
5-
"version": "2.6.23",
5+
"version": "2.6.24",
66
"homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking",
77
"repository": {
88
"type": "git",

plugin.template.xml

Lines changed: 1 addition & 1 deletion
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="2.6.23">
27+
version="2.6.24">
2828

2929
<!-- DO NOT EDIT THIS FILE. MAKE ALL CHANGES TO plugin.template.xml INSTEAD -->
3030

plugin.xml

Lines changed: 9 additions & 1 deletion
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="2.6.23">
27+
version="2.6.24">
2828

2929
<!-- DO NOT EDIT THIS FILE. MAKE ALL CHANGES TO plugin.template.xml INSTEAD -->
3030

@@ -93,6 +93,8 @@ SOFTWARE.
9393
<header-file src="src/ios/dependencies/Fabric/Fabric+FABKits.h" />
9494
<header-file src="src/ios/dependencies/Fabric/Fabric.h" />
9595

96+
<header-file src="src/ios/dependencies/Branch-SDK/BNCApplication.h" />
97+
<source-file src="src/ios/dependencies/Branch-SDK/BNCApplication.m" />
9698
<header-file src="src/ios/dependencies/Branch-SDK/BNCAvailability.h" />
9799
<source-file src="src/ios/dependencies/Branch-SDK/BNCAvailability.m" />
98100
<header-file src="src/ios/dependencies/Branch-SDK/BNCCallbacks.h" />
@@ -117,6 +119,8 @@ SOFTWARE.
117119
<header-file src="src/ios/dependencies/Branch-SDK/BNCFabricAnswers.h" />
118120
<source-file src="src/ios/dependencies/Branch-SDK/BNCFabricAnswers.m" />
119121
<header-file src="src/ios/dependencies/Branch-SDK/BNCFieldDefines.h" />
122+
<header-file src="src/ios/dependencies/Branch-SDK/BNCKeyChain.h" />
123+
<source-file src="src/ios/dependencies/Branch-SDK/BNCKeyChain.m" />
120124
<header-file src="src/ios/dependencies/Branch-SDK/BNCLinkCache.h" />
121125
<source-file src="src/ios/dependencies/Branch-SDK/BNCLinkCache.m" />
122126
<header-file src="src/ios/dependencies/Branch-SDK/BNCLinkData.h" />
@@ -133,6 +137,10 @@ SOFTWARE.
133137
<source-file src="src/ios/dependencies/Branch-SDK/BNCStrongMatchHelper.m" />
134138
<header-file src="src/ios/dependencies/Branch-SDK/BNCSystemObserver.h" />
135139
<source-file src="src/ios/dependencies/Branch-SDK/BNCSystemObserver.m" />
140+
<header-file src="src/ios/dependencies/Branch-SDK/BNCURLBlackList.h" />
141+
<source-file src="src/ios/dependencies/Branch-SDK/BNCURLBlackList.m" />
142+
<header-file src="src/ios/dependencies/Branch-SDK/Branch+Validator.h" />
143+
<source-file src="src/ios/dependencies/Branch-SDK/Branch+Validator.m" />
136144
<header-file src="src/ios/dependencies/Branch-SDK/Branch.h" />
137145
<source-file src="src/ios/dependencies/Branch-SDK/Branch.m" />
138146
<header-file src="src/ios/dependencies/Branch-SDK/BranchActivityItemProvider.h" />

src/android/dependencies/Branch.jar

10.1 KB
Binary file not shown.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
@file BNCApplication.h
3+
@package Branch-SDK
4+
@brief Current application and extension info.
5+
6+
@author Edward Smith
7+
@date January 8, 2018
8+
@copyright Copyright © 2018 Branch. All rights reserved.
9+
*/
10+
11+
#if __has_feature(modules)
12+
@import Foundation;
13+
#else
14+
#import <Foundation/Foundation.h>
15+
#endif
16+
17+
@interface BNCApplication : NSObject
18+
19+
/// A reference to the current running application.
20+
+ (BNCApplication*_Nonnull) currentApplication;
21+
22+
/// The bundle identifier of the current
23+
@property (atomic, readonly) NSString*_Nullable bundleID;
24+
25+
/// The bundle display name from the info plist.
26+
@property (atomic, readonly) NSString*_Nullable displayName;
27+
28+
/// The bundle short display name from the info plist.
29+
@property (atomic, readonly) NSString*_Nullable shortDisplayName;
30+
31+
/// The short version ID as is typically shown to the user, like in iTunes or the app store.
32+
@property (atomic, readonly) NSString*_Nullable displayVersionString;
33+
34+
/// The version ID for developers use.
35+
@property (atomic, readonly) NSString*_Nullable versionString;
36+
37+
/// The creation date of the current executable.
38+
@property (atomic, readonly) NSDate*_Nullable currentBuildDate;
39+
40+
/// The creating date of the exectuble the first time it was recorded by Branch.
41+
@property (atomic, readonly) NSDate*_Nullable firstInstallBuildDate;
42+
43+
/// The date this app was installed on this device.
44+
@property (atomic, readonly) NSDate*_Nullable currentInstallDate;
45+
46+
/// The date this app was first installed on this device.
47+
@property (atomic, readonly) NSDate*_Nullable firstInstallDate;
48+
49+
/// Returns a dictionary of device / identity pairs.
50+
@property (atomic, readonly) NSDictionary<NSString*, NSString*>*_Nonnull deviceKeyIdentityValueDictionary;
51+
52+
@end
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
/**
2+
@file BNCApplication.m
3+
@package Branch-SDK
4+
@brief Current application and extension info.
5+
6+
@author Edward Smith
7+
@date January 8, 2018
8+
@copyright Copyright © 2018 Branch. All rights reserved.
9+
*/
10+
11+
#import "BNCApplication.h"
12+
#import "BNCLog.h"
13+
#import "BNCKeyChain.h"
14+
15+
static NSString*const kBranchKeychainService = @"BranchKeychainService";
16+
static NSString*const kBranchKeychainDevicesKey = @"BranchKeychainDevices";
17+
static NSString*const kBranchKeychainFirstBuildKey = @"BranchKeychainFirstBuild";
18+
static NSString*const kBranchKeychainFirstInstalldKey = @"BranchKeychainFirstInstall";
19+
20+
#pragma mark - BNCApplication
21+
22+
@implementation BNCApplication
23+
24+
+ (BNCApplication*) currentApplication {
25+
static BNCApplication *bnc_currentApplication = nil;
26+
static dispatch_once_t onceToken = 0;
27+
dispatch_once(&onceToken, ^{
28+
bnc_currentApplication = [BNCApplication createCurrentApplication];
29+
});
30+
return bnc_currentApplication;
31+
}
32+
33+
+ (BNCApplication*) createCurrentApplication {
34+
BNCApplication *application = [[BNCApplication alloc] init];
35+
if (!application) return application;
36+
NSDictionary *info = [NSBundle mainBundle].infoDictionary;
37+
38+
application->_bundleID = [NSBundle mainBundle].bundleIdentifier;
39+
application->_displayName = info[@"CFBundleDisplayName"];
40+
application->_shortDisplayName = info[@"CFBundleName"];
41+
42+
application->_displayVersionString = info[@"CFBundleShortVersionString"];
43+
application->_versionString = info[@"CFBundleVersion"];
44+
45+
application->_firstInstallBuildDate = [BNCApplication firstInstallBuildDate];
46+
application->_currentBuildDate = [BNCApplication currentBuildDate];
47+
48+
application->_firstInstallDate = [BNCApplication firstInstallDate];
49+
application->_currentInstallDate = [BNCApplication currentInstallDate];
50+
51+
return application;
52+
}
53+
54+
+ (NSDate*) currentBuildDate {
55+
NSURL *appURL = nil;
56+
NSURL *bundleURL = [NSBundle mainBundle].bundleURL;
57+
NSDictionary *info = [NSBundle mainBundle].infoDictionary;
58+
NSString *appName = info[(__bridge NSString*)kCFBundleExecutableKey];
59+
if (appName.length > 0 && bundleURL) {
60+
appURL = [bundleURL URLByAppendingPathComponent:appName];
61+
} else {
62+
NSString *path = [[NSProcessInfo processInfo].arguments firstObject];
63+
if (path) appURL = [NSURL fileURLWithPath:path];
64+
}
65+
if (appURL == nil)
66+
return nil;
67+
68+
NSError *error = nil;
69+
NSFileManager *fileManager = [NSFileManager defaultManager];
70+
NSDictionary *attributes = [fileManager attributesOfItemAtPath:appURL.path error:&error];
71+
if (error) {
72+
BNCLogError(@"Can't get build date: %@.", error);
73+
return nil;
74+
}
75+
NSDate * buildDate = [attributes fileCreationDate];
76+
if (buildDate == nil || [buildDate timeIntervalSince1970] <= 0.0) {
77+
BNCLogError(@"Invalid build date: %@.", buildDate);
78+
}
79+
return buildDate;
80+
}
81+
82+
+ (NSDate*) firstInstallBuildDate {
83+
NSError *error = nil;
84+
NSDate *firstBuildDate =
85+
[BNCKeyChain retrieveValueForService:kBranchKeychainService
86+
key:kBranchKeychainFirstBuildKey
87+
error:&error];
88+
if (firstBuildDate)
89+
return firstBuildDate;
90+
91+
firstBuildDate = [self currentBuildDate];
92+
error = [BNCKeyChain storeValue:firstBuildDate
93+
forService:kBranchKeychainService
94+
key:kBranchKeychainFirstBuildKey
95+
cloudAccessGroup:nil];
96+
97+
return firstBuildDate;
98+
}
99+
100+
+ (NSDate*) currentInstallDate {
101+
NSError *error = nil;
102+
NSFileManager *fileManager = [NSFileManager defaultManager];
103+
NSURL *libraryURL =
104+
[[fileManager URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] firstObject];
105+
NSDictionary *attributes = [fileManager attributesOfItemAtPath:libraryURL.path error:&error];
106+
if (error) {
107+
BNCLogError(@"Can't get library date: %@.", error);
108+
return nil;
109+
}
110+
NSDate *installDate = [attributes fileCreationDate];
111+
if (installDate == nil || [installDate timeIntervalSince1970] <= 0.0) {
112+
BNCLogError(@"Invalid install date.");
113+
}
114+
return installDate;
115+
}
116+
117+
+ (NSDate*) firstInstallDate {
118+
NSError *error = nil;
119+
NSDate* firstInstallDate =
120+
[BNCKeyChain retrieveValueForService:kBranchKeychainService
121+
key:kBranchKeychainFirstInstalldKey
122+
error:&error];
123+
if (firstInstallDate)
124+
return firstInstallDate;
125+
126+
firstInstallDate = [self currentInstallDate];
127+
error = [BNCKeyChain storeValue:firstInstallDate
128+
forService:kBranchKeychainService
129+
key:kBranchKeychainFirstInstalldKey
130+
cloudAccessGroup:nil];
131+
132+
return firstInstallDate;
133+
}
134+
135+
- (NSDictionary*) deviceKeyIdentityValueDictionary {
136+
@synchronized (self.class) {
137+
NSError *error = nil;
138+
NSDictionary *deviceDictionary =
139+
[BNCKeyChain retrieveValueForService:kBranchKeychainService
140+
key:kBranchKeychainDevicesKey
141+
error:&error];
142+
if (error) BNCLogWarning(@"While retrieving deviceKeyIdentityValueDictionary: %@.", error);
143+
if (!deviceDictionary) deviceDictionary = @{};
144+
return deviceDictionary;
145+
}
146+
}
147+
148+
@end

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.22.4";
15+
NSString * const BNC_SDK_VERSION = @"0.23.3";

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,11 @@ - (void)indexContentWithTitle:(NSString *)title
356356
expirationDate:(NSDate *)expirationDate
357357
callback:(callbackWithUrl)callback
358358
spotlightCallback:(callbackWithUrlAndSpotlightIdentifier)spotlightCallback {
359-
359+
360+
if (!userInfo) userInfo = @{};
361+
NSMutableDictionary *customData = [NSMutableDictionary dictionaryWithDictionary:userInfo];
362+
if (!customData) customData = [NSMutableDictionary dictionaryWithDictionary:@{}];
363+
360364
BNCSpotlightService* spotlightService = [[BNCSpotlightService alloc] init];
361365

362366
BranchUniversalObject *universalObject = [[BranchUniversalObject alloc] initWithTitle:title];
@@ -366,7 +370,7 @@ - (void)indexContentWithTitle:(NSString *)title
366370
[universalObject.contentMetadata setContentSchema:type];
367371
[universalObject setImageUrl:[thumbnailUrl absoluteString]];
368372
[universalObject setKeywords:[keywords allObjects]];
369-
[universalObject.contentMetadata setCustomMetadata:[NSMutableDictionary dictionaryWithDictionary:userInfo]];
373+
[universalObject.contentMetadata setCustomMetadata:customData];
370374
[universalObject setExpirationDate:expirationDate];
371375

372376
if(publiclyIndexable) {

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

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1+
/**
2+
@file BNCDebug.h
3+
@package Branch-SDK
4+
@brief Debugging Support.
15
6+
@author Edward Smith
7+
@date October 2016
8+
@copyright Copyright © 2016 Branch. All rights reserved.
9+
*/
210

3-
//--------------------------------------------------------------------------------------------------
4-
//
5-
// BNCDebug.h
6-
// Branch.framework
7-
//
8-
// Debugging Support
9-
// Edward Smith, October 2016
10-
//
11-
// -©- Copyright © 2016 Branch, all rights reserved. -©-
12-
//
13-
//--------------------------------------------------------------------------------------------------
14-
15-
16-
//--------------------------------------------------------------------------------------------------
1711
/**
12+
@discusion
1813
19-
BNCDebug
20-
========
14+
# BNCDebug
2115
22-
# Useful run time debugging environmental variables
16+
## Useful run time debugging environmental variables
2317
2418
Set DYLD_IMAGE_SUFFIX to _debug to load debug versions of dynamic libraries.
2519
Set NSDebugEnabled to YES to enable obj-c debug checks.
@@ -44,9 +38,7 @@
4438
Search the heap for all references to the pointer 0x0000000116e13920:
4539
4640
ptr_refs -m 0x0000000116e13920
47-
4841
*/
49-
//--------------------------------------------------------------------------------------------------
5042

5143
#if __has_feature(modules)
5244
@import Foundation;

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1+
/**
2+
@file BNCDebug.m
3+
@package Branch-SDK
4+
@brief Debugging Support.
15
2-
3-
//--------------------------------------------------------------------------------------------------
4-
//
5-
// BNCDebug.m
6-
// Branch.framework
7-
//
8-
// Debugging Support
9-
// Edward Smith, October 2016
10-
//
11-
// -©- Copyright © 2016 Branch, all rights reserved. -©-
12-
//
13-
//--------------------------------------------------------------------------------------------------
14-
6+
@author Edward Smith
7+
@date October 2016
8+
@copyright Copyright © 2016 Branch. All rights reserved.
9+
*/
1510

1611
#import "BNCDebug.h"
1712
#if __has_feature(modules)
@@ -22,7 +17,6 @@
2217
#import <objc/runtime.h>
2318
#endif
2419

25-
2620
BOOL BNCDebuggerIsAttached() {
2721
// From an Apple tech note that I've lost --EB Smith
2822

0 commit comments

Comments
 (0)