Skip to content

Commit d6e8b61

Browse files
committed
Updated if statements
1 parent 0b84096 commit d6e8b61

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

Sources/BranchSDK/BNCRequestFactory.m

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ - (void)addInstrumentationToJSON:(NSMutableDictionary *)json {
499499
// BNCReferringURLUtility requires the endpoint string to determine which query params are applied
500500
- (void)addReferringURLsToJSON:(NSMutableDictionary *)json forEndpoint:(NSString *)endpoint {
501501
// Not a singleton, but BNCReferringURLUtility does pull from storage
502-
if ([self.preferenceHelper attributionLevel] == BranchAttributionLevelFull ||
503-
[self.preferenceHelper attributionLevelInitialized] == false) {
502+
if ([[self.preferenceHelper attributionLevel] isEqualToString:BranchAttributionLevelFull] ||
503+
![self.preferenceHelper attributionLevelInitialized]) {
504504
BNCReferringURLUtility *utility = [BNCReferringURLUtility new];
505505
NSDictionary *urlQueryParams = [utility referringURLQueryParamsForEndpoint:endpoint];
506506
[json bnc_safeAddEntriesFromDictionary:urlQueryParams];
@@ -542,13 +542,13 @@ - (NSDictionary *)v2dictionary {
542542
} else {
543543
BranchAttributionLevel attributionLevel = [self.preferenceHelper attributionLevel];
544544

545-
if (attributionLevel == BranchAttributionLevelFull ||
546-
[self.preferenceHelper attributionLevelInitialized] == false) {
545+
if ([attributionLevel isEqualToString:BranchAttributionLevelFull] ||
546+
![self.preferenceHelper attributionLevelInitialized]) {
547547
[dictionary bnc_safeSetObject:self.deviceInfo.advertiserId forKey:@"idfa"];
548548
}
549-
550-
if (attributionLevel != BranchAttributionLevelNone ||
551-
[self.preferenceHelper attributionLevelInitialized] == false) {
549+
550+
if (![attributionLevel isEqualToString:BranchAttributionLevelNone] ||
551+
![self.preferenceHelper attributionLevelInitialized]) {
552552
[dictionary bnc_safeSetObject:self.deviceInfo.vendorId forKey:@"idfv"];
553553
}
554554
}
@@ -610,14 +610,14 @@ - (void)updateDeviceInfoToMutableDictionary:(NSMutableDictionary *)dict {
610610
[self.deviceInfo checkAdvertisingIdentifier];
611611

612612
// Only include hardware ID fields for Full Attribution Level
613-
if ([self.preferenceHelper attributionLevel] == BranchAttributionLevelFull
613+
if (([[self.preferenceHelper attributionLevel] isEqualToString:BranchAttributionLevelFull])
614614
|| [self.preferenceHelper attributionLevelInitialized] == false) {
615-
616-
// hardware id information. idfa, idfv or random
617-
NSString *hardwareId = [self.deviceInfo.hardwareId copy];
618-
NSString *hardwareIdType = [self.deviceInfo.hardwareIdType copy];
619-
NSNumber *isRealHardwareId = @(self.deviceInfo.isRealHardwareId);
620-
615+
616+
// hardware id information. idfa, idfv or random
617+
NSString *hardwareId = [self.deviceInfo.hardwareId copy];
618+
NSString *hardwareIdType = [self.deviceInfo.hardwareIdType copy];
619+
NSNumber *isRealHardwareId = @(self.deviceInfo.isRealHardwareId);
620+
621621
if (hardwareId != nil && hardwareIdType != nil && isRealHardwareId != nil) {
622622
dict[BRANCH_REQUEST_KEY_HARDWARE_ID] = hardwareId;
623623
dict[BRANCH_REQUEST_KEY_HARDWARE_ID_TYPE] = hardwareIdType;

Sources/BranchSDK/BNCSKAdNetwork.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ - (BOOL) shouldCallPostbackForDataResponse:(NSDictionary *) dataResponseDictiona
220220

221221
- (BOOL)isSKANAllowedForAttributionLevel {
222222
BranchAttributionLevel level = [[BNCPreferenceHelper sharedInstance] attributionLevel];
223-
return !(level == BranchAttributionLevelMinimal || level == BranchAttributionLevelNone);
223+
return !([level isEqualToString:BranchAttributionLevelMinimal] ||
224+
[level isEqualToString:BranchAttributionLevelNone]);
224225
}
225226

226227
@end

0 commit comments

Comments
 (0)