Skip to content

Commit 92546ca

Browse files
committed
SDK-562 add method to set plugin info.
1 parent 523f818 commit 92546ca

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Branch-SDK/Branch-SDK/BNCDeviceInfo.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
- (NSDictionary *) v2dictionary;
2222

2323
/*
24-
Everything below this line should be private.
25-
Currently BNCServerInterface updateDeviceInfoToMutableDictionary uses it.
24+
Everything below this line should be private. Thread safety is the callee's responsibility!
25+
26+
Currently BNCServerInterface.updateDeviceInfoToMutableDictionary and unit tests use these.
2627
*/
2728

2829
- (void)checkAdvertisingIdentifier;

Branch-SDK/Branch-SDK/BNCDeviceInfo.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ - (instancetype)init {
5555
}
5656

5757
- (void)registerPluginName:(NSString *)name version:(NSString *)version {
58-
self.pluginName = name;
59-
self.pluginVersion = version;
58+
@synchronized (self) {
59+
self.pluginName = name;
60+
self.pluginVersion = version;
61+
}
6062
}
6163

6264
- (void)loadDeviceInfo {

Branch-SDK/Branch-SDK/Branch.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#import "BNCUserAgentCollector.h"
4343
#import "BNCAppleSearchAds.h"
4444
#import "BNCFacebookAppLinks.h"
45+
#import "BNCDeviceInfo.h"
4546

4647
NSString * const BRANCH_FEATURE_TAG_SHARE = @"share";
4748
NSString * const BRANCH_FEATURE_TAG_REFERRAL = @"referral";
@@ -2312,6 +2313,9 @@ - (void)dealloc {
23122313
[[NSNotificationCenter defaultCenter] removeObserver:self];
23132314
}
23142315

2316+
- (void)registerPluginName:(NSString *)name version:(NSString *)version {
2317+
[[BNCDeviceInfo getInstance] registerPluginName:name version:version];
2318+
}
23152319

23162320
#pragma mark - BranchDeepLinkingControllerCompletionDelegate methods
23172321

0 commit comments

Comments
 (0)