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 22, 2024
1 parent fc9ad0b commit 1f79f21
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 26 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Criteo Publisher SDK Changelog
--------------------------------------------------------------------------------
## Version [7.0.0]

### Features
- Add InventoryGroupId parameter, update register method

--------------------------------------------------------------------------------
## Version [6.2.0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
static NSString *const criteoGoogleMediationPublisherIdKey = @"cpId";
static NSString *const criteoGoogleMediationAdUnitIdKey = @"adUnitId";
static NSString *const criteoGoogleMediationStoreIdKey = @"storeId";
static NSString *const criteoGoogleMediationInventoryGroupIdKey = @"pubId";
static NSString *const criteoGoogleMediationInventoryGroupIdKey = @"inventoryGroupId";

static void setJSONParsingError(NSError **error) {
if (error != nil) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ - (instancetype)initWithBanner:(CRBannerView *)ad {
@"{\"cpId\":\"testCpId\",\"adUnitId\":\"testAdUnitId\",\"storeId\":\"testStoreId\"}"

#define SERVER_PARAMETER_WITH_INVENTORY_GROUP_ID \
@"{\"cpId\":\"testCpId\",\"pubId\":\"testInventoryGroupId\",\"adUnitId\":\"testAdUnitId\",\"storeId\":\"testStoreId\"}"
@"{\"cpId\":\"testCpId\",\"inventoryGroupId\":\"testInventoryGroupId\",\"adUnitId\":\"testAdUnitId\",\"storeId\":\"testStoreId\"}"

@implementation CRBannerCustomEventTests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ - (void)testGoogleMediationParametersNormal {
NSError *error;
CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
parametersFromJSONString:
@"{\"cpId\":\"B-056946\", \"pubId\":\"testInventoryGroupId\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
@"{\"cpId\":\"B-056946\", \"inventoryGroupId\":\"testInventoryGroupId\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
error:&error];
XCTAssertNotNil(gmp);
XCTAssertEqualObjects(gmp.publisherId, @"B-056946");
Expand All @@ -43,7 +43,7 @@ - (void)testGoogleMediationParametersErrorSetToNil {
NSError *error = [NSError new];
CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
parametersFromJSONString:
@"{\"cpId\":\"B-056946\", \"pubId\":\"testInventoryGroupId\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
@"{\"cpId\":\"B-056946\", \"inventoryGroupId\":\"testInventoryGroupId\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
error:&error];
XCTAssertNil(error);
}
Expand All @@ -52,7 +52,7 @@ - (void)testGoogleMediationParametersErrorSetToNil {
- (void)testGoogleMediationParametersNilError {
CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
parametersFromJSONString:
@"{\"cpId\":\"B-056946\", \"pubId\":\"testInventoryGroupId\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
@"{\"cpId\":\"B-056946\", \"inventoryGroupId\":\"testInventoryGroupId\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
error:nil];
XCTAssertNotNil(gmp);
XCTAssertEqualObjects(gmp.publisherId, @"B-056946");
Expand Down Expand Up @@ -150,12 +150,12 @@ - (void)testGoogleMediationParametersTotallyBadJson {
XCTAssertEqual(error.code, GADErrorInvalidArgument);
}

// Blank pubId
- (void)testGoogleMediationParametersBlankPubId {
// Blank inventoryGroupId
- (void)testGoogleMediationParametersBlankInventoryGroupId {
NSError *error;
CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
parametersFromJSONString:
@"{\"cpId\":\"B-056946\", \"pubId\":\"\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
@"{\"cpId\":\"B-056946\", \"inventoryGroupId\":\"\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
error:&error];
XCTAssertNotNil(gmp);
XCTAssertEqualObjects(gmp.publisherId, @"B-056946");
Expand All @@ -164,8 +164,8 @@ - (void)testGoogleMediationParametersBlankPubId {
XCTAssertEqualObjects(gmp.storeId, @"B-056946");
}

// Nil pubId
- (void)testGoogleMediationParametersNilPubId {
// Nil inventoryGroupId
- (void)testGoogleMediationParametersNilInventoryGroupId {
NSError *error;
CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
parametersFromJSONString:
Expand All @@ -178,12 +178,12 @@ - (void)testGoogleMediationParametersNilPubId {
XCTAssertEqualObjects(gmp.storeId, @"B-056946");
}

// Non-string pubId
- (void)testGoogleMediationParametersNonStringPubId {
// Non-string inventoryGroupId
- (void)testGoogleMediationParametersNonStringInventoryGroupId {
NSError *error = [NSError new];
CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
parametersFromJSONString:
@"{\"cpId\":\"B-056946\", \"pubId\":1, \"adUnitID\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
@"{\"cpId\":\"B-056946\", \"inventoryGroupId\":1, \"adUnitID\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
error:&error];
XCTAssertNil(gmp);
XCTAssertEqual(error.code, GADErrorInvalidArgument);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ - (instancetype)initWithInterstitial:(CRInterstitial *)interstitial {
@"{\"cpId\":\"testCpId\",\"adUnitId\":\"testAdUnitId\",\"storeId\":\"testStoreId\"}"

#define SERVER_PARAMETER_WITH_INVENTORY_GROUP_ID \
@"{\"cpId\":\"testCpId\",\"pubId\":\"testInventoryGroupId\",\"adUnitId\":\"testAdUnitId\",\"storeId\":\"testStoreId\"}"
@"{\"cpId\":\"testCpId\",\"inventoryGroupId\":\"testInventoryGroupId\",\"adUnitId\":\"testAdUnitId\",\"storeId\":\"testStoreId\"}"

@implementation CRInterstitialCustomEventTests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ - (NSDictionary *)postBody {
};
[body setValuesForKeysWithDictionary:values];
if (self.inventoryGroupId != nil) {
[body setObject:self.inventoryGroupId forKey:@"pubId"];
[body setObject:self.inventoryGroupId forKey:@"inventoryGroupId"];
}
return body;
}
Expand Down
2 changes: 1 addition & 1 deletion CriteoPublisherSdk/Sources/Network/CR_ApiQueryKeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(class, nonatomic, readonly) NSString *cdbCallEndElapsed;
@property(class, nonatomic, readonly) NSString *cdbCallStartElapsed;
@property(class, nonatomic, readonly) NSString *cpId;
@property(class, nonatomic, readonly) NSString *pubId;
@property(class, nonatomic, readonly) NSString *inventoryGroupId;
@property(class, nonatomic, readonly) NSString *deviceModel;
@property(class, nonatomic, readonly) NSString *deviceIdType;
@property(class, nonatomic, readonly) NSString *deviceId;
Expand Down
4 changes: 2 additions & 2 deletions CriteoPublisherSdk/Sources/Network/CR_ApiQueryKeys.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ + (NSString *)api {
+ (NSString *)storeId {
return @"storeId";
}
+ (NSString *)pubId {
return @"pubId";
+ (NSString *)inventoryGroupId {
return @"inventoryGroupId";
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ - (NSDictionary *)publisherWithConfig:(CR_Config *)config context:(CRContextData
NSMutableDictionary *publisher = [NSMutableDictionary new];
publisher[CR_ApiQueryKeys.bundleId] = config.appId;
publisher[CR_ApiQueryKeys.cpId] = config.criteoPublisherId;
publisher[CR_ApiQueryKeys.pubId] = config.inventoryGroupId;
publisher[CR_ApiQueryKeys.inventoryGroupId] = config.inventoryGroupId;
publisher[CR_ApiQueryKeys.ext] =
[CR_BidRequestSerializer mergeToNestedStructure:@[ contextData.data ]];
publisher[CR_ApiQueryKeys.storeId] = config.storeId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ - (void)testToPostPayload_GivenConfig {
- (void)testToPostPayloadWithInventoryGroupId_GivenConfig {
CR_Config *config = OCMClassMock([CR_Config class]);
OCMStub(config.criteoPublisherId).andReturn(@"myCpId");
OCMStub(config.inventoryGroupId).andReturn(@"myPubId");
OCMStub(config.inventoryGroupId).andReturn(@"myInventoryGroupId");
OCMStub(config.sdkVersion).andReturn(@"1.3.3.7");
OCMStub(config.appId).andReturn(@"myAppId");
OCMStub(config.deviceModel).andReturn(@"myDeviceModel");
Expand All @@ -69,7 +69,7 @@ - (void)testToPostPayloadWithInventoryGroupId_GivenConfig {

NSDictionary *expected = @{
@"cpId" : @"myCpId",
@"pubId" : @"myPubId",
@"inventoryGroupId" : @"myInventoryGroupId",
@"bundleId" : @"myAppId",
@"sdkVersion" : @"1.3.3.7",
@"rtbProfileId" : profileId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ - (void)testCdbCallContainsSdkAndProfile {
- (void)testCdbCallContainsPublisherInfo {
NSDictionary *expected = @{
CR_ApiQueryKeys.cpId : self.configMock.criteoPublisherId,
CR_ApiQueryKeys.pubId : self.configMock.inventoryGroupId,
CR_ApiQueryKeys.inventoryGroupId : self.configMock.inventoryGroupId,
CR_ApiQueryKeys.bundleId : self.configMock.appId,
CR_ApiQueryKeys.storeId : self.configMock.storeId,
CR_ApiQueryKeys.ext : @{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class CR_BidRequestSerializerSwiftTests: XCTestCase {
let expected: NSDictionary = [
NSString.bundleIdKey: config.appId,
NSString.cpIdKey: config.criteoPublisherId!,
NSString.pubIdKey: config.inventoryGroupId!,
NSString.inventoryGroupIdKey: config.inventoryGroupId!,
"ext": NSDictionary()
]
let body = generateBody()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN

@property(copy, nonatomic, class, readonly) NSString *bundleIdKey;
@property(copy, nonatomic, class, readonly) NSString *cpIdKey;
@property(copy, nonatomic, class, readonly) NSString *pubIdKey;
@property(copy, nonatomic, class, readonly) NSString *inventoryGroupIdKey;

#pragma mark User

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ + (NSString *)cpIdKey {
return @"cpId";
}

+ (NSString *)pubIdKey {
return @"pubId";
+ (NSString *)inventoryGroupIdKey {
return @"inventoryGroupId";
}

#pragma mark - User
Expand Down

0 comments on commit 1f79f21

Please sign in to comment.