Skip to content

Commit

Permalink
release 7.0.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliy-pavlenko committed Jul 17, 2024
1 parent fb425cc commit 60961dd
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ - (void)loadBannerForAdUnit:(CRBannerAdUnit *)adUnit
childDirectedTreatment:(NSNumber *)childDirectedTreatment {
/// Set the publisher id to
[Criteo.sharedCriteo registerCriteoPublisherId:params.publisherId
withInventoryGroupId:params.inventoryGroupId
withInventoryGroupId:params.inventoryGroupId
withStoreId:params.storeId
withAdUnits:@[ adUnit ]];
/// Set child directed treatment flag to Criteo SDK.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN

- (instancetype)init NS_UNAVAILABLE;
- (id)initWithPublisherId:(NSString *)publisherId
inventoryGroupId:(NSString *)inventoryGroupId
inventoryGroupId:(NSString *)inventoryGroupId
storeId:(NSString *)storeId
adUnitId:(NSString *)adUnitId;
+ (nullable CRGoogleMediationParameters *)parametersFromJSONString:(NSString *)jsonString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static void setJSONParsingError(NSError **error) {
@implementation CRGoogleMediationParameters

- (id)initWithPublisherId:(NSString *)publisherId
inventoryGroupId:(NSString *)inventoryGroupId
inventoryGroupId:(NSString *)inventoryGroupId
storeId:(NSString *)storeId
adUnitId:(NSString *)adUnitId {
self = [super init];
Expand Down Expand Up @@ -78,7 +78,8 @@ + (nullable CRGoogleMediationParameters *)parametersFromJSONString:(NSString *)j
NSString *pubId = nonEmptyStringFromObj(jsonDict[criteoGoogleMediationPublisherIdKey]);
NSString *adId = nonEmptyStringFromObj(jsonDict[criteoGoogleMediationAdUnitIdKey]);
NSString *storeId = nonEmptyStringFromObj(jsonDict[criteoGoogleMediationStoreIdKey]);
NSString *inventoryGroupId = nonEmptyStringFromObj(jsonDict[criteoGoogleMediationInventoryGroupIdKey]);
NSString *inventoryGroupId =
nonEmptyStringFromObj(jsonDict[criteoGoogleMediationInventoryGroupIdKey]);
if (pubId == nil || adId == nil) {
setJSONParsingError(error);
return nil;
Expand All @@ -87,7 +88,7 @@ + (nullable CRGoogleMediationParameters *)parametersFromJSONString:(NSString *)j
*error = nil;
}
return [[CRGoogleMediationParameters alloc] initWithPublisherId:pubId
inventoryGroupId:inventoryGroupId
inventoryGroupId:inventoryGroupId
storeId:storeId
adUnitId:adId];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ - (void)loadInterstitialForAdUnit:(CRInterstitialAdUnit *)adUnit
adConfiguration:(CRGoogleMediationParameters *)params
childDirectedTreatment:(NSNumber *)childDirectedTreatment {
[Criteo.sharedCriteo registerCriteoPublisherId:params.publisherId
withInventoryGroupId:params.inventoryGroupId
withInventoryGroupId:params.inventoryGroupId
withStoreId:params.storeId
withAdUnits:@[ adUnit ]];
/// Set child directed treatment flag to Criteo SDK.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ - (void)testRequestBannerAdSuccess {
id mockCriteo = OCMClassMock([Criteo class]);
OCMStub([mockCriteo sharedCriteo]).andReturn(mockCriteo);
OCMStub([mockCriteo registerCriteoPublisherId:@"testCpId"
withInventoryGroupId:@"testInventoryGroupId"
withInventoryGroupId:@"testInventoryGroupId"
withStoreId:@"testStoreId"
withAdUnits:@[ bannerAdUnit ]]);
OCMStub([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
Expand All @@ -83,7 +83,7 @@ - (void)testRequestBannerAdSuccess {
OCMVerify([mockCRBannerView loadAd]);
OCMVerify([mockCRBannerView setDelegate:customEvent]);
OCMVerify([mockCriteo registerCriteoPublisherId:@"testCpId"
withInventoryGroupId:@"testInventoryGroupId"
withInventoryGroupId:@"testInventoryGroupId"
withStoreId:@"testStoreId"
withAdUnits:@[ bannerAdUnit ]]);
OCMVerify([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ - (void)testLoadAndPresentFromRootViewController {
id mockCriteo = OCMStrictClassMock([Criteo class]);
OCMStub([mockCriteo sharedCriteo]).andReturn(mockCriteo);
OCMStub([mockCriteo registerCriteoPublisherId:@"testCpId"
withInventoryGroupId:@"testInventoryGroupId"
withInventoryGroupId:@"testInventoryGroupId"
withStoreId:@"testStoreId"
withAdUnits:@[ interstitialAdUnit ]]);
OCMStub([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
Expand All @@ -92,7 +92,7 @@ - (void)testLoadAndPresentFromRootViewController {
OCMVerify([mockCRInterstitial setDelegate:customEvent]);
OCMVerify([mockCRInterstitial presentFromRootViewController:realVC]);
OCMVerify([mockCriteo registerCriteoPublisherId:@"testCpId"
withInventoryGroupId:@"testInventoryGroupId"
withInventoryGroupId:@"testInventoryGroupId"
withStoreId:@"testStoreId"
withAdUnits:@[ interstitialAdUnit ]]);
OCMVerify([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
Expand Down
6 changes: 3 additions & 3 deletions CriteoPublisherSdk/Sources/Configuration/CR_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ FOUNDATION_EXTERN NSString *const CR_ConfigConfigurationUrl;
#pragma mark - Lifecycle

- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
inventoryGroupId:(nullable NSString *)inventoryGroupId
inventoryGroupId:(nullable NSString *)inventoryGroupId
storeId:(nullable NSString *)storeId
cdbUrl:(NSString *)cdbUrl
appEventsUrl:(NSString *)appEventsUrl
configUrl:(NSString *)configUrl
userDefaults:(NSUserDefaults *)userDefaults NS_DESIGNATED_INITIALIZER;

- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
inventoryGroupId:(nullable NSString *)inventoryGroupId
inventoryGroupId:(nullable NSString *)inventoryGroupId
storeId:(nullable NSString *)storeId;

- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
inventoryGroupId:(nullable NSString *)inventoryGroupId;
inventoryGroupId:(nullable NSString *)inventoryGroupId;

- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId;

Expand Down
14 changes: 7 additions & 7 deletions CriteoPublisherSdk/Sources/Configuration/CR_Config.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ @interface CR_Config ()
@implementation CR_Config

- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
inventoryGroupId:(nullable NSString *)inventoryGroupId
inventoryGroupId:(nullable NSString *)inventoryGroupId
storeId:(nullable NSString *)storeId
cdbUrl:(NSString *)cdbUrl
appEventsUrl:(NSString *)appEventsUrl
Expand Down Expand Up @@ -85,7 +85,7 @@ - (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId

- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId {
return [self initWithCriteoPublisherId:criteoPublisherId
inventoryGroupId:nil
inventoryGroupId:nil
storeId:nil
cdbUrl:CR_ConfigCdbUrl
appEventsUrl:CR_ConfigAppEventsUrl
Expand All @@ -94,9 +94,9 @@ - (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
}

- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
inventoryGroupId:(nullable NSString *)inventoryGroupId {
inventoryGroupId:(nullable NSString *)inventoryGroupId {
return [self initWithCriteoPublisherId:criteoPublisherId
inventoryGroupId:inventoryGroupId
inventoryGroupId:inventoryGroupId
storeId:nil
cdbUrl:CR_ConfigCdbUrl
appEventsUrl:CR_ConfigAppEventsUrl
Expand All @@ -105,10 +105,10 @@ - (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
}

- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
inventoryGroupId:(nullable NSString *)inventoryGroupId
inventoryGroupId:(nullable NSString *)inventoryGroupId
storeId:(nullable NSString *)storeId {
return [self initWithCriteoPublisherId:criteoPublisherId
inventoryGroupId:inventoryGroupId
inventoryGroupId:inventoryGroupId
storeId:storeId
cdbUrl:CR_ConfigCdbUrl
appEventsUrl:CR_ConfigAppEventsUrl
Expand All @@ -122,7 +122,7 @@ - (instancetype)init {

- (instancetype)initWithUserDefaults:(NSUserDefaults *)userDefaults {
return [self initWithCriteoPublisherId:nil
inventoryGroupId:nil
inventoryGroupId:nil
storeId:nil
cdbUrl:CR_ConfigCdbUrl
appEventsUrl:CR_ConfigAppEventsUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ @interface CR_RemoteConfigRequest ()
@property(copy, nonatomic) NSString *deviceOs;

- (instancetype)initWithCriteoPublisherId:(NSString *)criteoPublisherId
inventoryGroupId:(NSString *)inventoryGroupId
inventoryGroupId:(NSString *)inventoryGroupId
sdkVersion:(NSString *)sdkVersion
appId:(NSString *)appId
profileId:(NSNumber *)profileId
Expand All @@ -45,7 +45,7 @@ @implementation CR_RemoteConfigRequest

+ (instancetype)requestWithConfig:(CR_Config *)config profileId:(NSNumber *)profileId {
return [CR_RemoteConfigRequest.alloc initWithCriteoPublisherId:config.criteoPublisherId
inventoryGroupId:config.inventoryGroupId
inventoryGroupId:config.inventoryGroupId
sdkVersion:config.sdkVersion
appId:config.appId
profileId:profileId
Expand All @@ -55,7 +55,7 @@ + (instancetype)requestWithConfig:(CR_Config *)config profileId:(NSNumber *)prof
}

- (instancetype)initWithCriteoPublisherId:(NSString *)criteoPublisherId
inventoryGroupId:(NSString *)inventoryGroupId
inventoryGroupId:(NSString *)inventoryGroupId
sdkVersion:(NSString *)sdkVersion
appId:(NSString *)appId
profileId:(NSNumber *)profileId
Expand All @@ -78,7 +78,7 @@ - (instancetype)initWithCriteoPublisherId:(NSString *)criteoPublisherId
- (NSDictionary *)postBody {
return @{
@"cpId" : self.criteoPublisherId,
@"pubId": self.inventoryGroupId,
@"pubId" : self.inventoryGroupId,
@"bundleId" : self.appId,
@"sdkVersion" : self.sdkVersion,
@"rtbProfileId" : self.profileId,
Expand Down
6 changes: 3 additions & 3 deletions CriteoPublisherSdk/Sources/Criteo.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ + (void)resetSharedCriteo {
}

- (void)registerCriteoPublisherId:(NSString *)criteoPublisherId
withInventoryGroupId:(NSString *)inventoryGroupId
withInventoryGroupId:(NSString *)inventoryGroupId
withStoreId:(NSString *)storeId
withAdUnits:(NSArray<CRAdUnit *> *)adUnits {
if (criteoPublisherId == nil || criteoPublisherId.length == 0) {
Expand All @@ -111,7 +111,7 @@ - (void)registerCriteoPublisherId:(NSString *)criteoPublisherId
@try {
[self.dependencyProvider.threadManager dispatchAsyncOnGlobalQueue:^{
[self _registerCriteoPublisherId:criteoPublisherId
withInventoryGroupId:inventoryGroupId
withInventoryGroupId:inventoryGroupId
withStoreId:storeId
withAdUnits:adUnits];
CRLogInfo(@"Registration",
Expand Down Expand Up @@ -198,7 +198,7 @@ - (instancetype)initWithDependencyProvider:(CR_DependencyProvider *)dependencyPr
}

- (void)_registerCriteoPublisherId:(NSString *)criteoPublisherId
withInventoryGroupId:(NSString *)inventoryGroupId
withInventoryGroupId:(NSString *)inventoryGroupId
withStoreId:(NSString *)storeId
withAdUnits:(NSArray<CRAdUnit *> *)adUnits {
self.config.criteoPublisherId = criteoPublisherId;
Expand Down
2 changes: 1 addition & 1 deletion CriteoPublisherSdk/Sources/Public/Criteo.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param adUnits AdUnits array
*/
- (void)registerCriteoPublisherId:(NSString *)criteoPublisherId
withInventoryGroupId:(NSString *)inventoryGroupId
withInventoryGroupId:(NSString *)inventoryGroupId
withStoreId:(NSString *)storeId
withAdUnits:(NSArray<CRAdUnit *> *)adUnits;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ - (void)testVerboseLogsEnabled {

- (void)testCriteoRegister_ShouldBeLogged {
[self.criteo registerCriteoPublisherId:self.publisherId
withInventoryGroupId:@""
withInventoryGroupId:@""
withStoreId:@""
withAdUnits:self.adUnits];
OCMVerify([self.loggingMock logMessage:[OCMArg checkWithBlock:^BOOL(CR_LogMessage *logMessage) {
Expand All @@ -149,12 +149,12 @@ - (void)testCriteoRegister_ShouldBeLogged {

- (void)testCriteoRegisterTwice_ShouldBeLogged {
[self.criteo registerCriteoPublisherId:self.publisherId
withInventoryGroupId:self.inventoryGroupId
withInventoryGroupId:self.inventoryGroupId
withStoreId:self.storeId
withAdUnits:self.adUnits];
OCMVerify([self.loggingMock logMessage:[OCMArg any]]);
[self.criteo registerCriteoPublisherId:self.publisherId
withInventoryGroupId:self.inventoryGroupId
withInventoryGroupId:self.inventoryGroupId
withStoreId:self.storeId
withAdUnits:self.adUnits];
OCMVerify([self.loggingMock logMessage:[OCMArg checkWithBlock:^BOOL(CR_LogMessage *logMessage) {
Expand Down
6 changes: 3 additions & 3 deletions CriteoPublisherSdk/Tests/UnitTests/CriteoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ - (void)testRegister_GivenNilPublisherId_LogError {
NSString *nilInventoryGroupId = nil;
NSString *nilStoreId = nil;
[criteo registerCriteoPublisherId:nilPublisherId
withInventoryGroupId:nilInventoryGroupId
withInventoryGroupId:nilInventoryGroupId
withStoreId:nilStoreId
withAdUnits:@[]];

Expand All @@ -115,7 +115,7 @@ - (void)testRegister_GivenEmptyPublisherId_LogError {
NSString *emptyInventoryGroupId = @"";
NSString *emptyStoreId = @"";
[criteo registerCriteoPublisherId:emptyPublisherId
withInventoryGroupId:emptyInventoryGroupId
withInventoryGroupId:emptyInventoryGroupId
withStoreId:emptyStoreId
withAdUnits:@[]];

Expand Down Expand Up @@ -330,7 +330,7 @@ - (void)registerWithMockedDependencyProvider:(void (^)(CR_DependencyProvider *))
testBlock(dependencyProviderMock);
Criteo *criteo = [[Criteo alloc] initWithDependencyProvider:dependencyProviderMock];
[criteo registerCriteoPublisherId:@"testPublisherId"
withInventoryGroupId:@"testInventoryGroupId"
withInventoryGroupId:@"testInventoryGroupId"
withStoreId:@"testStoreId"
withAdUnits:@[]];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ - (NSString *)wireMockEndPoint:(NSString *)path {
- (CR_DependencyProvider *)withWireMockConfiguration {
self.config =
[[CR_Config alloc] initWithCriteoPublisherId:CriteoTestingPublisherId
inventoryGroupId:CriteoTestingInventoryGroupId
inventoryGroupId:CriteoTestingInventoryGroupId
storeId:CriteoTestingStoreId
cdbUrl:[self wireMockEndPoint:@"cdb"]
appEventsUrl:[self wireMockEndPoint:@"gum/appevent/v1"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ - (void)testing_registerBanner {

- (void)testing_registerWithAdUnits:(NSArray<CRAdUnit *> *)adUnits {
[self registerCriteoPublisherId:CriteoTestingPublisherId
withInventoryGroupId:CriteoTestingInventoryGroupId
withInventoryGroupId:CriteoTestingInventoryGroupId
withStoreId:CriteoTestingStoreId
withAdUnits:adUnits];
}
Expand Down

0 comments on commit 60961dd

Please sign in to comment.