Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consent GDPR reference update. #315

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CriteoPublisherSdk/Sources/Criteo.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ - (void)setup {
[self.class setVerboseLogsEnabled:YES];
}

CR_Gdpr *gdpr = self.dependencyProvider.consent.gdpr;
CR_Gdpr *gdpr = [self.dependencyProvider.consent gdpr];
CRLogInfo(@"Consent", @"Initialized with TCF: %@", gdpr);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ FOUNDATION_EXTERN NSString *const CR_DataProtectionConsentGivenKey;
*/
@interface CR_DataProtectionConsent : NSObject

/**
Object that handle all the GDPR logic.
*/
@property(strong, nonatomic, readonly) CR_Gdpr *gdpr;

/**
* Nullable ATTrackingManagerAuthorizationStatus
*
Expand Down Expand Up @@ -69,6 +64,8 @@ FOUNDATION_EXTERN NSString *const CR_DataProtectionConsentGivenKey;
- (instancetype)init;
- (instancetype)initWithUserDefaults:(NSUserDefaults *)userDefaults NS_DESIGNATED_INITIALIZER;

- (CR_Gdpr *)gdpr;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,15 @@ - (instancetype)initWithUserDefaults:(NSUserDefaults *)userDefaults {
if (self = [super init]) {
_userDefaults = userDefaults;
_ccpa = [[CR_Ccpa alloc] initWithUserDefaults:userDefaults];
_gdpr = [[CR_Gdpr alloc] initWithUserDefaults:userDefaults];
_consentGiven = self.userDefaultForConsentGiven;
}
return self;
}

- (CR_Gdpr *)gdpr {
return [[CR_Gdpr alloc] initWithUserDefaults:_userDefaults];
}

- (NSNumber *)trackingAuthorizationStatus {
if (@available(iOS 14.0, *)) {
return @(ATTrackingManager.trackingAuthorizationStatus);
Expand Down
2 changes: 1 addition & 1 deletion CriteoPublisherSdk/Sources/Network/CR_ApiHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ - (NSString *)urlQueryParamsForAppEventWithEvent:(NSString *)event
paramDict[CR_ApiQueryKeys.appId] = config.appId;
paramDict[CR_ApiQueryKeys.trackingAuthorizationStatus] =
consent.trackingAuthorizationStatus.stringValue;
paramDict[CR_ApiQueryKeys.gdprConsentForGum] = consent.gdpr.consentString;
paramDict[CR_ApiQueryKeys.gdprConsentForGum] = [consent gdpr].consentString;
NSString *params = [NSString cr_urlQueryParamsWithDictionary:paramDict];
return params;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ - (NSDictionary *)bodyWithCdbRequest:(CR_CdbRequest *)cdbRequest
postBody[CR_ApiQueryKeys.profileId] = cdbRequest.profileId;
postBody[CR_ApiQueryKeys.id] = cdbRequest.requestGroupId;
postBody[CR_ApiQueryKeys.publisher] = [self publisherWithConfig:config context:contextData];
postBody[CR_ApiQueryKeys.gdprConsent] = [self.gdprSerializer dictionaryForGdpr:consent.gdpr];
postBody[CR_ApiQueryKeys.gdprConsent] = [self.gdprSerializer dictionaryForGdpr:[consent gdpr]];
postBody[CR_ApiQueryKeys.bidSlots] = [self slotsWithCdbRequest:cdbRequest config:config];
postBody[CR_ApiQueryKeys.user] = [self userWithConsent:consent
config:config
Expand Down
Loading