diff --git a/CHANGELOG.md b/CHANGELOG.md
index fa5214e4..38e0ac73 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,10 @@
# Criteo Publisher SDK Changelog
+--------------------------------------------------------------------------------
+## Version [7.0.0]
+
+### Features
+- Add InventoryGroupId parameter, update register method
+
--------------------------------------------------------------------------------
## Version [6.2.0]
diff --git a/CriteoAdViewer/Sources/AdViewer/AdViewerViewController.swift b/CriteoAdViewer/Sources/AdViewer/AdViewerViewController.swift
index f8d5580c..b258b67e 100644
--- a/CriteoAdViewer/Sources/AdViewer/AdViewerViewController.swift
+++ b/CriteoAdViewer/Sources/AdViewer/AdViewerViewController.swift
@@ -259,7 +259,7 @@ class AdViewerViewController: FormViewController {
Criteo.resetSharedCriteo()
let criteo = Criteo.shared()
criteo.networkManagerDelegate = LogManager.sharedInstance()
- criteo.registerPublisherId(publisherId, withStoreId: "testStoreid", with: adUnits)
+ criteo.registerPublisherId(publisherId, withInventoryGroupId: "someId", withStoreId: "testStoreid", with: adUnits)
return criteo
}
diff --git a/CriteoAdViewer/Sources/Info.plist b/CriteoAdViewer/Sources/Info.plist
index 17db209e..77a2cd9e 100644
--- a/CriteoAdViewer/Sources/Info.plist
+++ b/CriteoAdViewer/Sources/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 6.2.0
+ 7.0.0
CFBundleURLTypes
diff --git a/CriteoAdViewer/UITests/Info.plist b/CriteoAdViewer/UITests/Info.plist
index 2460f3b7..b18ad9f0 100644
--- a/CriteoAdViewer/UITests/Info.plist
+++ b/CriteoAdViewer/UITests/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 6.2.0
+ 7.0.0
CFBundleVersion
1
diff --git a/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRBannerCustomEvent.m b/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRBannerCustomEvent.m
index 2f854491..5024a63c 100644
--- a/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRBannerCustomEvent.m
+++ b/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRBannerCustomEvent.m
@@ -42,8 +42,9 @@ @implementation CRBannerCustomEvent
- (void)loadBannerForAdUnit:(CRBannerAdUnit *)adUnit
mediationParams:(CRGoogleMediationParameters *)params
childDirectedTreatment:(NSNumber *)childDirectedTreatment {
- /// Set the publicher id to
+ /// Set the publisher id to
[Criteo.sharedCriteo registerCriteoPublisherId:params.publisherId
+ withInventoryGroupId:params.inventoryGroupId
withStoreId:params.storeId
withAdUnits:@[ adUnit ]];
/// Set child directed treatment flag to Criteo SDK.
diff --git a/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRGoogleMediationParameters.h b/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRGoogleMediationParameters.h
index c4de802c..3e2a2622 100644
--- a/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRGoogleMediationParameters.h
+++ b/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRGoogleMediationParameters.h
@@ -25,6 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)init NS_UNAVAILABLE;
- (id)initWithPublisherId:(NSString *)publisherId
+ inventoryGroupId:(NSString *)inventoryGroupId
storeId:(NSString *)storeId
adUnitId:(NSString *)adUnitId;
+ (nullable CRGoogleMediationParameters *)parametersFromJSONString:(NSString *)jsonString
@@ -33,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(copy, readonly) NSString *publisherId;
@property(copy, readonly) NSString *adUnitId;
@property(copy, readonly) NSString *storeId;
+@property(copy, nullable, readonly) NSString *inventoryGroupId;
@end
diff --git a/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRGoogleMediationParameters.m b/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRGoogleMediationParameters.m
index 11b6cd1e..f0c808f9 100644
--- a/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRGoogleMediationParameters.m
+++ b/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRGoogleMediationParameters.m
@@ -23,6 +23,7 @@
static NSString *const criteoGoogleMediationPublisherIdKey = @"cpId";
static NSString *const criteoGoogleMediationAdUnitIdKey = @"adUnitId";
static NSString *const criteoGoogleMediationStoreIdKey = @"storeId";
+static NSString *const criteoGoogleMediationInventoryGroupIdKey = @"inventoryGroupId";
static void setJSONParsingError(NSError **error) {
if (error != nil) {
@@ -44,6 +45,7 @@ static void setJSONParsingError(NSError **error) {
@implementation CRGoogleMediationParameters
- (id)initWithPublisherId:(NSString *)publisherId
+ inventoryGroupId:(NSString *)inventoryGroupId
storeId:(NSString *)storeId
adUnitId:(NSString *)adUnitId {
self = [super init];
@@ -53,6 +55,9 @@ - (id)initWithPublisherId:(NSString *)publisherId
_publisherId = [NSString stringWithString:publisherId];
_adUnitId = [NSString stringWithString:adUnitId];
_storeId = [NSString stringWithString:storeId];
+ if (inventoryGroupId != nil) {
+ _inventoryGroupId = [NSString stringWithString:inventoryGroupId];
+ }
return self;
}
@@ -75,6 +80,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]);
if (pubId == nil || adId == nil) {
setJSONParsingError(error);
return nil;
@@ -83,6 +90,7 @@ + (nullable CRGoogleMediationParameters *)parametersFromJSONString:(NSString *)j
*error = nil;
}
return [[CRGoogleMediationParameters alloc] initWithPublisherId:pubId
+ inventoryGroupId:inventoryGroupId
storeId:storeId
adUnitId:adId];
}
diff --git a/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRInterstitialCustomEvent.m b/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRInterstitialCustomEvent.m
index 331b99bc..f775d1c6 100644
--- a/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRInterstitialCustomEvent.m
+++ b/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/CRInterstitialCustomEvent.m
@@ -43,6 +43,7 @@ - (void)loadInterstitialForAdUnit:(CRInterstitialAdUnit *)adUnit
adConfiguration:(CRGoogleMediationParameters *)params
childDirectedTreatment:(NSNumber *)childDirectedTreatment {
[Criteo.sharedCriteo registerCriteoPublisherId:params.publisherId
+ withInventoryGroupId:params.inventoryGroupId
withStoreId:params.storeId
withAdUnits:@[ adUnit ]];
/// Set child directed treatment flag to Criteo SDK.
diff --git a/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/Info.plist b/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/Info.plist
index 4147d585..c0d870c5 100644
--- a/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/Info.plist
+++ b/CriteoGoogleAdapter/Sources/CriteoGoogleAdapter/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 6.2.0
+ 7.0.0
CFBundleVersion
1
diff --git a/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRBannerCustomEventTests.m b/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRBannerCustomEventTests.m
index 4cfdf81a..2f74e212 100644
--- a/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRBannerCustomEventTests.m
+++ b/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRBannerCustomEventTests.m
@@ -54,6 +54,9 @@ - (instancetype)initWithBanner:(CRBannerView *)ad {
#define SERVER_PARAMETER \
@"{\"cpId\":\"testCpId\",\"adUnitId\":\"testAdUnitId\",\"storeId\":\"testStoreId\"}"
+#define SERVER_PARAMETER_WITH_INVENTORY_GROUP_ID \
+ @"{\"cpId\":\"testCpId\",\"inventoryGroupId\":\"testInventoryGroupId\",\"adUnitId\":\"testAdUnitId\",\"storeId\":\"testStoreId\"}"
+
@implementation CRBannerCustomEventTests
- (void)testRequestBannerAdSuccess {
@@ -71,6 +74,41 @@ - (void)testRequestBannerAdSuccess {
id mockCriteo = OCMClassMock([Criteo class]);
OCMStub([mockCriteo sharedCriteo]).andReturn(mockCriteo);
OCMStub([mockCriteo registerCriteoPublisherId:@"testCpId"
+ withInventoryGroupId:nil
+ withStoreId:@"testStoreId"
+ withAdUnits:@[ bannerAdUnit ]]);
+ OCMStub([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
+
+ [customEvent loadBannerForAdUnit:bannerAdUnit
+ mediationParams:params
+ childDirectedTreatment:mockChildDirectedTreatment];
+
+ OCMVerify([mockCRBannerView loadAd]);
+ OCMVerify([mockCRBannerView setDelegate:customEvent]);
+ OCMVerify([mockCriteo registerCriteoPublisherId:@"testCpId"
+ withInventoryGroupId:nil
+ withStoreId:@"testStoreId"
+ withAdUnits:@[ bannerAdUnit ]]);
+ OCMVerify([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
+}
+
+- (void)testRequestBannerAdSuccessWithInventoryGroupId {
+ NSNumber *mockChildDirectedTreatment = @YES;
+ CRBannerView *mockCRBannerView = OCMStrictClassMock([CRBannerView class]);
+ CRBannerAdUnit *bannerAdUnit = [[CRBannerAdUnit alloc] initWithAdUnitId:@"testAdUnitId"
+ size:CGSizeMake(320, 50)];
+ CRBannerCustomEvent *customEvent = [[CRBannerCustomEvent alloc] initWithBanner:mockCRBannerView];
+ CRGoogleMediationParameters *params =
+ [CRGoogleMediationParameters parametersFromJSONString:SERVER_PARAMETER_WITH_INVENTORY_GROUP_ID
+ error:NULL];
+
+ OCMStub([mockCRBannerView loadAd]);
+ OCMStub([mockCRBannerView setDelegate:customEvent]);
+
+ id mockCriteo = OCMClassMock([Criteo class]);
+ OCMStub([mockCriteo sharedCriteo]).andReturn(mockCriteo);
+ OCMStub([mockCriteo registerCriteoPublisherId:@"testCpId"
+ withInventoryGroupId:@"testInventoryGroupId"
withStoreId:@"testStoreId"
withAdUnits:@[ bannerAdUnit ]]);
OCMStub([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
@@ -82,6 +120,7 @@ - (void)testRequestBannerAdSuccess {
OCMVerify([mockCRBannerView loadAd]);
OCMVerify([mockCRBannerView setDelegate:customEvent]);
OCMVerify([mockCriteo registerCriteoPublisherId:@"testCpId"
+ withInventoryGroupId:@"testInventoryGroupId"
withStoreId:@"testStoreId"
withAdUnits:@[ bannerAdUnit ]]);
OCMVerify([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
diff --git a/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRGoogleMediationParametersTests.m b/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRGoogleMediationParametersTests.m
index 35e1d412..6c05fd34 100644
--- a/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRGoogleMediationParametersTests.m
+++ b/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRGoogleMediationParametersTests.m
@@ -29,10 +29,11 @@ - (void)testGoogleMediationParametersNormal {
NSError *error;
CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
parametersFromJSONString:
- @"{\"cpId\":\"B-056946\", \"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");
+ XCTAssertEqualObjects(gmp.inventoryGroupId, @"testInventoryGroupId");
XCTAssertEqualObjects(gmp.adUnitId, @"/140800857/Endeavour_320x50");
XCTAssertEqualObjects(gmp.storeId, @"B-056946");
}
@@ -42,7 +43,7 @@ - (void)testGoogleMediationParametersErrorSetToNil {
NSError *error = [NSError new];
CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
parametersFromJSONString:
- @"{\"cpId\":\"B-056946\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
+ @"{\"cpId\":\"B-056946\", \"inventoryGroupId\":\"testInventoryGroupId\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
error:&error];
XCTAssertNil(error);
}
@@ -51,10 +52,11 @@ - (void)testGoogleMediationParametersErrorSetToNil {
- (void)testGoogleMediationParametersNilError {
CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
parametersFromJSONString:
- @"{\"cpId\":\"B-056946\", \"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");
+ XCTAssertEqualObjects(gmp.inventoryGroupId, @"testInventoryGroupId");
XCTAssertEqualObjects(gmp.adUnitId, @"/140800857/Endeavour_320x50");
XCTAssertEqualObjects(gmp.storeId, @"B-056946");
}
@@ -148,4 +150,43 @@ - (void)testGoogleMediationParametersTotallyBadJson {
XCTAssertEqual(error.code, GADErrorInvalidArgument);
}
+// Blank inventoryGroupId
+- (void)testGoogleMediationParametersBlankInventoryGroupId {
+ NSError *error;
+ CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
+ parametersFromJSONString:
+ @"{\"cpId\":\"B-056946\", \"inventoryGroupId\":\"\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
+ error:&error];
+ XCTAssertNotNil(gmp);
+ XCTAssertEqualObjects(gmp.publisherId, @"B-056946");
+ XCTAssertNil(gmp.inventoryGroupId);
+ XCTAssertEqualObjects(gmp.adUnitId, @"/140800857/Endeavour_320x50");
+ XCTAssertEqualObjects(gmp.storeId, @"B-056946");
+}
+
+// Nil inventoryGroupId
+- (void)testGoogleMediationParametersNilInventoryGroupId {
+ NSError *error;
+ CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
+ parametersFromJSONString:
+ @"{\"cpId\":\"B-056946\", \"adUnitId\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
+ error:&error];
+ XCTAssertNotNil(gmp);
+ XCTAssertEqualObjects(gmp.publisherId, @"B-056946");
+ XCTAssertNil(gmp.inventoryGroupId);
+ XCTAssertEqualObjects(gmp.adUnitId, @"/140800857/Endeavour_320x50");
+ XCTAssertEqualObjects(gmp.storeId, @"B-056946");
+}
+
+// Non-string inventoryGroupId
+- (void)testGoogleMediationParametersNonStringInventoryGroupId {
+ NSError *error = [NSError new];
+ CRGoogleMediationParameters *gmp = [CRGoogleMediationParameters
+ parametersFromJSONString:
+ @"{\"cpId\":\"B-056946\", \"inventoryGroupId\":1, \"adUnitID\": \"/140800857/Endeavour_320x50\", \"storeId\": \"B-056946\"}"
+ error:&error];
+ XCTAssertNil(gmp);
+ XCTAssertEqual(error.code, GADErrorInvalidArgument);
+}
+
@end
diff --git a/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRInterstitialCustomEventTests.m b/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRInterstitialCustomEventTests.m
index c642e398..1cc952a5 100644
--- a/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRInterstitialCustomEventTests.m
+++ b/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/CRInterstitialCustomEventTests.m
@@ -58,6 +58,9 @@ - (instancetype)initWithInterstitial:(CRInterstitial *)interstitial {
#define SERVER_PARAMETER \
@"{\"cpId\":\"testCpId\",\"adUnitId\":\"testAdUnitId\",\"storeId\":\"testStoreId\"}"
+#define SERVER_PARAMETER_WITH_INVENTORY_GROUP_ID \
+ @"{\"cpId\":\"testCpId\",\"inventoryGroupId\":\"testInventoryGroupId\",\"adUnitId\":\"testAdUnitId\",\"storeId\":\"testStoreId\"}"
+
@implementation CRInterstitialCustomEventTests
- (void)testLoadAndPresentFromRootViewController {
@@ -78,6 +81,46 @@ - (void)testLoadAndPresentFromRootViewController {
id mockCriteo = OCMStrictClassMock([Criteo class]);
OCMStub([mockCriteo sharedCriteo]).andReturn(mockCriteo);
OCMStub([mockCriteo registerCriteoPublisherId:@"testCpId"
+ withInventoryGroupId:nil
+ withStoreId:@"testStoreId"
+ withAdUnits:@[ interstitialAdUnit ]]);
+ OCMStub([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
+
+ [customEvent loadInterstitialForAdUnit:interstitialAdUnit
+ adConfiguration:params
+ childDirectedTreatment:mockChildDirectedTreatment];
+ [customEvent presentFromViewController:realVC];
+
+ OCMVerify([mockCRInterstitial loadAd]);
+ OCMVerify([mockCRInterstitial setDelegate:customEvent]);
+ OCMVerify([mockCRInterstitial presentFromRootViewController:realVC]);
+ OCMVerify([mockCriteo registerCriteoPublisherId:@"testCpId"
+ withInventoryGroupId:nil
+ withStoreId:@"testStoreId"
+ withAdUnits:@[ interstitialAdUnit ]]);
+ OCMVerify([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
+}
+
+- (void)testLoadAndPresentFromRootViewControllerWithInventoryGroupId {
+ NSNumber *mockChildDirectedTreatment = @YES;
+ CRInterstitial *mockCRInterstitial = OCMStrictClassMock([CRInterstitial class]);
+ CRInterstitialAdUnit *interstitialAdUnit =
+ [[CRInterstitialAdUnit alloc] initWithAdUnitId:@"testAdUnitId"];
+ CRInterstitialCustomEvent *customEvent =
+ [[CRInterstitialCustomEvent alloc] initWithInterstitial:mockCRInterstitial];
+ CRGoogleMediationParameters *params =
+ [CRGoogleMediationParameters parametersFromJSONString:SERVER_PARAMETER_WITH_INVENTORY_GROUP_ID
+ error:NULL];
+ OCMStub([mockCRInterstitial loadAd]);
+ OCMStub([mockCRInterstitial setDelegate:customEvent]);
+ UIViewController *realVC = [UIViewController new];
+ OCMStub([mockCRInterstitial presentFromRootViewController:realVC]);
+ OCMStub([mockCRInterstitial isAdLoaded]).andReturn(YES);
+
+ id mockCriteo = OCMStrictClassMock([Criteo class]);
+ OCMStub([mockCriteo sharedCriteo]).andReturn(mockCriteo);
+ OCMStub([mockCriteo registerCriteoPublisherId:@"testCpId"
+ withInventoryGroupId:@"testInventoryGroupId"
withStoreId:@"testStoreId"
withAdUnits:@[ interstitialAdUnit ]]);
OCMStub([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
@@ -91,6 +134,7 @@ - (void)testLoadAndPresentFromRootViewController {
OCMVerify([mockCRInterstitial setDelegate:customEvent]);
OCMVerify([mockCRInterstitial presentFromRootViewController:realVC]);
OCMVerify([mockCriteo registerCriteoPublisherId:@"testCpId"
+ withInventoryGroupId:@"testInventoryGroupId"
withStoreId:@"testStoreId"
withAdUnits:@[ interstitialAdUnit ]]);
OCMVerify([mockCriteo setChildDirectedTreatment:mockChildDirectedTreatment]);
diff --git a/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/Info.plist b/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/Info.plist
index 2460f3b7..b18ad9f0 100644
--- a/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/Info.plist
+++ b/CriteoGoogleAdapter/Tests/CriteoGoogleAdapterTests/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 6.2.0
+ 7.0.0
CFBundleVersion
1
diff --git a/CriteoPublisherSdk.podspec b/CriteoPublisherSdk.podspec
index e606f44f..91c9106b 100644
--- a/CriteoPublisherSdk.podspec
+++ b/CriteoPublisherSdk.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "CriteoPublisherSdk"
- spec.version = "6.2.0"
+ spec.version = "7.0.0-rc1"
spec.summary = "Criteo Publisher SDK for iOS"
spec.description = <<-DESC
diff --git a/CriteoPublisherSdk/Sources/Configuration/CR_Config.h b/CriteoPublisherSdk/Sources/Configuration/CR_Config.h
index 1fd420dd..b5f88675 100644
--- a/CriteoPublisherSdk/Sources/Configuration/CR_Config.h
+++ b/CriteoPublisherSdk/Sources/Configuration/CR_Config.h
@@ -34,6 +34,7 @@ FOUNDATION_EXTERN NSString *const CR_ConfigConfigurationUrl;
#pragma mark - Properties
@property(copy, nonatomic, nullable) NSString *criteoPublisherId;
+@property(copy, nonatomic, nullable) NSString *inventoryGroupId;
@property(assign, nonatomic) BOOL killSwitch;
@property(copy, nonatomic) NSString *adTagUrlMode;
@property(copy, nonatomic) NSString *viewportWidthMacro;
@@ -79,6 +80,7 @@ FOUNDATION_EXTERN NSString *const CR_ConfigConfigurationUrl;
#pragma mark - Lifecycle
- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
+ inventoryGroupId:(nullable NSString *)inventoryGroupId
storeId:(nullable NSString *)storeId
cdbUrl:(NSString *)cdbUrl
appEventsUrl:(NSString *)appEventsUrl
@@ -86,8 +88,12 @@ FOUNDATION_EXTERN NSString *const CR_ConfigConfigurationUrl;
userDefaults:(NSUserDefaults *)userDefaults NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
+ inventoryGroupId:(nullable NSString *)inventoryGroupId
storeId:(nullable NSString *)storeId;
+- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
+ inventoryGroupId:(nullable NSString *)inventoryGroupId;
+
- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId;
- (instancetype)initWithUserDefaults:(NSUserDefaults *)userDefaults;
diff --git a/CriteoPublisherSdk/Sources/Configuration/CR_Config.m b/CriteoPublisherSdk/Sources/Configuration/CR_Config.m
index 4ce7a706..96d58a85 100644
--- a/CriteoPublisherSdk/Sources/Configuration/CR_Config.m
+++ b/CriteoPublisherSdk/Sources/Configuration/CR_Config.m
@@ -43,6 +43,7 @@ @interface CR_Config ()
@implementation CR_Config
- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
+ inventoryGroupId:(nullable NSString *)inventoryGroupId
storeId:(nullable NSString *)storeId
cdbUrl:(NSString *)cdbUrl
appEventsUrl:(NSString *)appEventsUrl
@@ -77,12 +78,14 @@ - (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
_mraid2Enabled = [userDefaults cr_valueForMRAID2];
_isMRAIDGlobalEnabled = _mraidEnabled || _mraid2Enabled;
_storeId = storeId;
+ _inventoryGroupId = inventoryGroupId;
}
return self;
}
- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId {
return [self initWithCriteoPublisherId:criteoPublisherId
+ inventoryGroupId:nil
storeId:nil
cdbUrl:CR_ConfigCdbUrl
appEventsUrl:CR_ConfigAppEventsUrl
@@ -91,8 +94,21 @@ - (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
}
- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
+ inventoryGroupId:(nullable NSString *)inventoryGroupId {
+ return [self initWithCriteoPublisherId:criteoPublisherId
+ inventoryGroupId:inventoryGroupId
+ storeId:nil
+ cdbUrl:CR_ConfigCdbUrl
+ appEventsUrl:CR_ConfigAppEventsUrl
+ configUrl:CR_ConfigConfigurationUrl
+ userDefaults:[NSUserDefaults standardUserDefaults]];
+}
+
+- (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
+ inventoryGroupId:(nullable NSString *)inventoryGroupId
storeId:(nullable NSString *)storeId {
return [self initWithCriteoPublisherId:criteoPublisherId
+ inventoryGroupId:inventoryGroupId
storeId:storeId
cdbUrl:CR_ConfigCdbUrl
appEventsUrl:CR_ConfigAppEventsUrl
@@ -106,6 +122,7 @@ - (instancetype)init {
- (instancetype)initWithUserDefaults:(NSUserDefaults *)userDefaults {
return [self initWithCriteoPublisherId:nil
+ inventoryGroupId:nil
storeId:nil
cdbUrl:CR_ConfigCdbUrl
appEventsUrl:CR_ConfigAppEventsUrl
diff --git a/CriteoPublisherSdk/Sources/Configuration/CR_RemoteConfigRequest.m b/CriteoPublisherSdk/Sources/Configuration/CR_RemoteConfigRequest.m
index 3d3deec8..2c9e7c74 100644
--- a/CriteoPublisherSdk/Sources/Configuration/CR_RemoteConfigRequest.m
+++ b/CriteoPublisherSdk/Sources/Configuration/CR_RemoteConfigRequest.m
@@ -28,8 +28,10 @@ @interface CR_RemoteConfigRequest ()
@property(copy, nonatomic) NSNumber *profileId;
@property(copy, nonatomic) NSString *deviceModel;
@property(copy, nonatomic) NSString *deviceOs;
+@property(copy, nonatomic, nullable) NSString *inventoryGroupId;
- (instancetype)initWithCriteoPublisherId:(NSString *)criteoPublisherId
+ inventoryGroupId:(nullable NSString *)inventoryGroupId
sdkVersion:(NSString *)sdkVersion
appId:(NSString *)appId
profileId:(NSNumber *)profileId
@@ -43,6 +45,7 @@ @implementation CR_RemoteConfigRequest
+ (instancetype)requestWithConfig:(CR_Config *)config profileId:(NSNumber *)profileId {
return [CR_RemoteConfigRequest.alloc initWithCriteoPublisherId:config.criteoPublisherId
+ inventoryGroupId:config.inventoryGroupId
sdkVersion:config.sdkVersion
appId:config.appId
profileId:profileId
@@ -52,6 +55,7 @@ + (instancetype)requestWithConfig:(CR_Config *)config profileId:(NSNumber *)prof
}
- (instancetype)initWithCriteoPublisherId:(NSString *)criteoPublisherId
+ inventoryGroupId:(nullable NSString *)inventoryGroupId
sdkVersion:(NSString *)sdkVersion
appId:(NSString *)appId
profileId:(NSNumber *)profileId
@@ -60,6 +64,7 @@ - (instancetype)initWithCriteoPublisherId:(NSString *)criteoPublisherId
configUrl:(NSString *)configUrl {
if (self = [super init]) {
_criteoPublisherId = criteoPublisherId;
+ _inventoryGroupId = inventoryGroupId;
_sdkVersion = sdkVersion;
_appId = appId;
_profileId = profileId;
@@ -71,7 +76,8 @@ - (instancetype)initWithCriteoPublisherId:(NSString *)criteoPublisherId
}
- (NSDictionary *)postBody {
- return @{
+ NSMutableDictionary *body = [NSMutableDictionary dictionary];
+ NSDictionary *values = @{
@"cpId" : self.criteoPublisherId,
@"bundleId" : self.appId,
@"sdkVersion" : self.sdkVersion,
@@ -79,6 +85,11 @@ - (NSDictionary *)postBody {
@"deviceModel" : self.deviceModel,
@"deviceOs" : self.deviceOs
};
+ [body setValuesForKeysWithDictionary:values];
+ if (self.inventoryGroupId != nil) {
+ [body setObject:self.inventoryGroupId forKey:@"inventoryGroupId"];
+ }
+ return body;
}
@end
diff --git a/CriteoPublisherSdk/Sources/Criteo.m b/CriteoPublisherSdk/Sources/Criteo.m
index 774de1cd..4ea33675 100644
--- a/CriteoPublisherSdk/Sources/Criteo.m
+++ b/CriteoPublisherSdk/Sources/Criteo.m
@@ -93,8 +93,28 @@ + (void)resetSharedCriteo {
}
- (void)registerCriteoPublisherId:(NSString *)criteoPublisherId
+ withInventoryGroupId:(NSString *)inventoryGroupId
withStoreId:(NSString *)storeId
withAdUnits:(NSArray *)adUnits {
+ [self registerCriteoPublisherIdWrapper:criteoPublisherId
+ withInventoryGroupId:inventoryGroupId
+ withStoreId:storeId
+ withAdUnits:adUnits];
+}
+
+- (void)registerCriteoPublisherId:(NSString *)criteoPublisherId
+ withStoreId:(NSString *)storeId
+ withAdUnits:(NSArray *)adUnits {
+ [self registerCriteoPublisherIdWrapper:criteoPublisherId
+ withInventoryGroupId:nil
+ withStoreId:storeId
+ withAdUnits:adUnits];
+}
+
+- (void)registerCriteoPublisherIdWrapper:(NSString *)criteoPublisherId
+ withInventoryGroupId:(NSString *)inventoryGroupId
+ withStoreId:(NSString *)storeId
+ withAdUnits:(NSArray *)adUnits {
if (criteoPublisherId == nil || criteoPublisherId.length == 0) {
CRLogError(@"Registration", @"Invalid Criteo publisher ID: \"%@\"", criteoPublisherId);
}
@@ -107,6 +127,7 @@ - (void)registerCriteoPublisherId:(NSString *)criteoPublisherId
@try {
[self.dependencyProvider.threadManager dispatchAsyncOnGlobalQueue:^{
[self _registerCriteoPublisherId:criteoPublisherId
+ withInventoryGroupId:inventoryGroupId
withStoreId:storeId
withAdUnits:adUnits];
CRLogInfo(@"Registration",
@@ -193,9 +214,11 @@ - (instancetype)initWithDependencyProvider:(CR_DependencyProvider *)dependencyPr
}
- (void)_registerCriteoPublisherId:(NSString *)criteoPublisherId
+ withInventoryGroupId:(NSString *)inventoryGroupId
withStoreId:(NSString *)storeId
withAdUnits:(NSArray *)adUnits {
self.config.criteoPublisherId = criteoPublisherId;
+ self.config.inventoryGroupId = inventoryGroupId;
self.config.storeId = storeId;
[self.appEvents registerForIosEvents];
[self.appEvents sendLaunchEvent];
diff --git a/CriteoPublisherSdk/Sources/Info.plist b/CriteoPublisherSdk/Sources/Info.plist
index 4147d585..c0d870c5 100644
--- a/CriteoPublisherSdk/Sources/Info.plist
+++ b/CriteoPublisherSdk/Sources/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 6.2.0
+ 7.0.0
CFBundleVersion
1
diff --git a/CriteoPublisherSdk/Sources/Network/CR_ApiQueryKeys.h b/CriteoPublisherSdk/Sources/Network/CR_ApiQueryKeys.h
index 916eccd1..94772f20 100644
--- a/CriteoPublisherSdk/Sources/Network/CR_ApiQueryKeys.h
+++ b/CriteoPublisherSdk/Sources/Network/CR_ApiQueryKeys.h
@@ -36,6 +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 *inventoryGroupId;
@property(class, nonatomic, readonly) NSString *deviceModel;
@property(class, nonatomic, readonly) NSString *deviceIdType;
@property(class, nonatomic, readonly) NSString *deviceId;
diff --git a/CriteoPublisherSdk/Sources/Network/CR_ApiQueryKeys.m b/CriteoPublisherSdk/Sources/Network/CR_ApiQueryKeys.m
index 655099b0..e5e2c0b5 100644
--- a/CriteoPublisherSdk/Sources/Network/CR_ApiQueryKeys.m
+++ b/CriteoPublisherSdk/Sources/Network/CR_ApiQueryKeys.m
@@ -174,5 +174,8 @@ + (NSString *)api {
+ (NSString *)storeId {
return @"storeId";
}
++ (NSString *)inventoryGroupId {
+ return @"inventoryGroupId";
+}
@end
diff --git a/CriteoPublisherSdk/Sources/Network/Serializers/CR_BidRequestSerializer.m b/CriteoPublisherSdk/Sources/Network/Serializers/CR_BidRequestSerializer.m
index b054425b..07972e1c 100644
--- a/CriteoPublisherSdk/Sources/Network/Serializers/CR_BidRequestSerializer.m
+++ b/CriteoPublisherSdk/Sources/Network/Serializers/CR_BidRequestSerializer.m
@@ -134,6 +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.inventoryGroupId] = config.inventoryGroupId;
publisher[CR_ApiQueryKeys.ext] =
[CR_BidRequestSerializer mergeToNestedStructure:@[ contextData.data ]];
publisher[CR_ApiQueryKeys.storeId] = config.storeId;
diff --git a/CriteoPublisherSdk/Sources/Public/CRConstants.h b/CriteoPublisherSdk/Sources/Public/CRConstants.h
index fade6dab..11c6b602 100644
--- a/CriteoPublisherSdk/Sources/Public/CRConstants.h
+++ b/CriteoPublisherSdk/Sources/Public/CRConstants.h
@@ -20,7 +20,7 @@
#ifndef CRConstants_h
#define CRConstants_h
-#define CRITEO_PUBLISHER_SDK_VERSION @"6.2.0"
+#define CRITEO_PUBLISHER_SDK_VERSION @"7.0.0-rc1"
#define CRITEO_DEFAULT_REQUEST_TIMEOUT_IN_SECONDS 60
#define CRITEO_DEFAULT_BID_TTL_IN_SECONDS 15 * 60
diff --git a/CriteoPublisherSdk/Sources/Public/Criteo.h b/CriteoPublisherSdk/Sources/Public/Criteo.h
index d08da7a9..d6774f74 100644
--- a/CriteoPublisherSdk/Sources/Public/Criteo.h
+++ b/CriteoPublisherSdk/Sources/Public/Criteo.h
@@ -49,6 +49,18 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (nonnull instancetype)sharedCriteo;
+/**
+ * Initialize Criteo singleton
+ * @param criteoPublisherId Publisher Identifier
+ * @param inventoryGroupId Inventory group identifier
+ * @param storeId Publisher's app store id
+ * @param adUnits AdUnits array
+ */
+- (void)registerCriteoPublisherId:(NSString *)criteoPublisherId
+ withInventoryGroupId:(NSString *)inventoryGroupId
+ withStoreId:(NSString *)storeId
+ withAdUnits:(NSArray *)adUnits;
+
/**
* Initialize Criteo singleton
* @param criteoPublisherId Publisher Identifier
diff --git a/CriteoPublisherSdk/Tests/CriteoPublisherSdkTests-Info.plist b/CriteoPublisherSdk/Tests/CriteoPublisherSdkTests-Info.plist
index 2460f3b7..b18ad9f0 100644
--- a/CriteoPublisherSdk/Tests/CriteoPublisherSdkTests-Info.plist
+++ b/CriteoPublisherSdk/Tests/CriteoPublisherSdkTests-Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 6.2.0
+ 7.0.0
CFBundleVersion
1
diff --git a/CriteoPublisherSdk/Tests/IntegrationTests/CR_LoggingFunctionalTests.m b/CriteoPublisherSdk/Tests/IntegrationTests/CR_LoggingFunctionalTests.m
index 9c6cfba6..012a4730 100644
--- a/CriteoPublisherSdk/Tests/IntegrationTests/CR_LoggingFunctionalTests.m
+++ b/CriteoPublisherSdk/Tests/IntegrationTests/CR_LoggingFunctionalTests.m
@@ -39,6 +39,7 @@ @interface CR_LoggingFunctionalTests : XCTestCase
@property(nonatomic, strong) CR_ConsoleLogHandler *consoleLogHandlerMock;
@property(strong, nonatomic) Criteo *criteo;
@property(nonatomic, copy) NSString *publisherId;
+@property(nonatomic, copy) NSString *inventoryGroupId;
@property(nonatomic, strong) NSArray *adUnits;
@property(nonatomic, strong) NSUserDefaults *userDefaults;
@property(nonatomic, strong) CR_ApiHandler *apiHandler;
@@ -67,6 +68,7 @@ - (void)setUp {
dependencyProvider.logging = self.loggingMock;
self.publisherId = @"testPublisherId";
+ self.inventoryGroupId = @"testInventoryGroupId";
self.storeId = @"testStoreId";
self.adUnits = @[
[[CRBannerAdUnit alloc] initWithAdUnitId:@"adUnitId1" size:CGSizeMake(42, 21)],
@@ -142,6 +144,19 @@ - (void)testCriteoRegister_ShouldBeLogged {
}]]);
}
+- (void)testCriteoRegisterWithInventoryGroupId_ShouldBeLogged {
+ [self.criteo registerCriteoPublisherId:self.publisherId
+ withInventoryGroupId:self.inventoryGroupId
+ withStoreId:@""
+ withAdUnits:self.adUnits];
+ OCMVerify([self.loggingMock logMessage:[OCMArg checkWithBlock:^BOOL(CR_LogMessage *logMessage) {
+ NSString *message = logMessage.message;
+ return [logMessage.tag isEqualToString:@"Registration"] &&
+ [message containsString:self.publisherId] &&
+ [message containsString:self.adUnits.description];
+ }]]);
+}
+
- (void)testCriteoRegisterTwice_ShouldBeLogged {
[self.criteo registerCriteoPublisherId:self.publisherId
withStoreId:self.storeId
diff --git a/CriteoPublisherSdk/Tests/UnitTests/Configuration/CR_ConfigManagerTests.m b/CriteoPublisherSdk/Tests/UnitTests/Configuration/CR_ConfigManagerTests.m
index 12c4676a..e10f0ba7 100644
--- a/CriteoPublisherSdk/Tests/UnitTests/Configuration/CR_ConfigManagerTests.m
+++ b/CriteoPublisherSdk/Tests/UnitTests/Configuration/CR_ConfigManagerTests.m
@@ -43,7 +43,7 @@ @implementation CR_ConfigManagerTests {
#pragma mark - Lifecycle
- (void)setUp {
- localConfig = [[CR_Config alloc] initWithCriteoPublisherId:@"1337"];
+ localConfig = [[CR_Config alloc] initWithCriteoPublisherId:@"1337" inventoryGroupId:@"test"];
mockApiHandler = OCMStrictClassMock(CR_ApiHandler.class);
mockIntegrationRegistry = OCMStrictClassMock(CR_IntegrationRegistry.class);
OCMStub([mockIntegrationRegistry profileId]).andReturn(@42);
diff --git a/CriteoPublisherSdk/Tests/UnitTests/Configuration/CR_RemoteConfigRequestTests.m b/CriteoPublisherSdk/Tests/UnitTests/Configuration/CR_RemoteConfigRequestTests.m
index 0393c471..11064231 100644
--- a/CriteoPublisherSdk/Tests/UnitTests/Configuration/CR_RemoteConfigRequestTests.m
+++ b/CriteoPublisherSdk/Tests/UnitTests/Configuration/CR_RemoteConfigRequestTests.m
@@ -30,6 +30,7 @@ @implementation CR_RemoteConfigRequestTests
- (void)testToPostPayload_GivenConfig {
CR_Config *config = OCMClassMock([CR_Config class]);
OCMStub(config.criteoPublisherId).andReturn(@"myCpId");
+ OCMStub(config.inventoryGroupId).andReturn(nil);
OCMStub(config.sdkVersion).andReturn(@"1.3.3.7");
OCMStub(config.appId).andReturn(@"myAppId");
OCMStub(config.deviceModel).andReturn(@"myDeviceModel");
@@ -52,4 +53,31 @@ - (void)testToPostPayload_GivenConfig {
XCTAssertEqualObjects(postBody, expected);
}
+- (void)testToPostPayloadWithInventoryGroupId_GivenConfig {
+ CR_Config *config = OCMClassMock([CR_Config class]);
+ OCMStub(config.criteoPublisherId).andReturn(@"myCpId");
+ OCMStub(config.inventoryGroupId).andReturn(@"myInventoryGroupId");
+ OCMStub(config.sdkVersion).andReturn(@"1.3.3.7");
+ OCMStub(config.appId).andReturn(@"myAppId");
+ OCMStub(config.deviceModel).andReturn(@"myDeviceModel");
+ OCMStub(config.deviceOs).andReturn(@"myDeviceOs");
+ NSNumber *profileId = @42;
+
+ CR_RemoteConfigRequest *request = [CR_RemoteConfigRequest requestWithConfig:config
+ profileId:profileId];
+ NSDictionary *postBody = request.postBody;
+
+ NSDictionary *expected = @{
+ @"cpId" : @"myCpId",
+ @"inventoryGroupId" : @"myInventoryGroupId",
+ @"bundleId" : @"myAppId",
+ @"sdkVersion" : @"1.3.3.7",
+ @"rtbProfileId" : profileId,
+ @"deviceModel" : @"myDeviceModel",
+ @"deviceOs" : @"myDeviceOs"
+ };
+
+ XCTAssertEqualObjects(postBody, expected);
+}
+
@end
diff --git a/CriteoPublisherSdk/Tests/UnitTests/CriteoTests.m b/CriteoPublisherSdk/Tests/UnitTests/CriteoTests.m
index 7adb7992..3b30f67e 100644
--- a/CriteoPublisherSdk/Tests/UnitTests/CriteoTests.m
+++ b/CriteoPublisherSdk/Tests/UnitTests/CriteoTests.m
@@ -93,8 +93,12 @@ - (void)testRegister_GivenNilPublisherId_LogError {
CR_DependencyProvider *dependencyProviderMock = OCMClassMock(CR_DependencyProvider.class);
Criteo *criteo = [[Criteo alloc] initWithDependencyProvider:dependencyProviderMock];
NSString *nilPublisherId = nil;
+ NSString *nilInventoryGroupId = nil;
NSString *nilStoreId = nil;
- [criteo registerCriteoPublisherId:nilPublisherId withStoreId:nilStoreId withAdUnits:@[]];
+ [criteo registerCriteoPublisherId:nilPublisherId
+ withInventoryGroupId:nilInventoryGroupId
+ withStoreId:nilStoreId
+ withAdUnits:@[]];
OCMVerify([self.loggingMock logMessage:[OCMArg checkWithBlock:^BOOL(CR_LogMessage *logMessage) {
return logMessage.severity == CR_LogSeverityError &&
@@ -108,8 +112,12 @@ - (void)testRegister_GivenEmptyPublisherId_LogError {
CR_DependencyProvider *dependencyProviderMock = OCMClassMock(CR_DependencyProvider.class);
Criteo *criteo = [[Criteo alloc] initWithDependencyProvider:dependencyProviderMock];
NSString *emptyPublisherId = @"";
+ NSString *emptyInventoryGroupId = @"";
NSString *emptyStoreId = @"";
- [criteo registerCriteoPublisherId:emptyPublisherId withStoreId:emptyStoreId withAdUnits:@[]];
+ [criteo registerCriteoPublisherId:emptyPublisherId
+ withInventoryGroupId:emptyInventoryGroupId
+ withStoreId:emptyStoreId
+ withAdUnits:@[]];
OCMVerify([self.loggingMock logMessage:[OCMArg checkWithBlock:^BOOL(CR_LogMessage *logMessage) {
return logMessage.severity == CR_LogSeverityError &&
@@ -321,7 +329,10 @@ - (void)registerWithMockedDependencyProvider:(void (^)(CR_DependencyProvider *))
OCMStub(dependencyProviderMock.threadManager).andReturn(threadManager);
testBlock(dependencyProviderMock);
Criteo *criteo = [[Criteo alloc] initWithDependencyProvider:dependencyProviderMock];
- [criteo registerCriteoPublisherId:@"testPublisherId" withStoreId:@"testStoreId" withAdUnits:@[]];
+ [criteo registerCriteoPublisherId:@"testPublisherId"
+ withInventoryGroupId:@"testInventoryGroupId"
+ withStoreId:@"testStoreId"
+ withAdUnits:@[]];
}
- (void)mockBidManagerWithAdUnit:(CR_CacheAdUnit *)adUnit respondBid:(CR_CdbBid *)bid {
diff --git a/CriteoPublisherSdk/Tests/UnitTests/Network/CR_ApiHandlerTests.m b/CriteoPublisherSdk/Tests/UnitTests/Network/CR_ApiHandlerTests.m
index 2867b731..35e8c297 100644
--- a/CriteoPublisherSdk/Tests/UnitTests/Network/CR_ApiHandlerTests.m
+++ b/CriteoPublisherSdk/Tests/UnitTests/Network/CR_ApiHandlerTests.m
@@ -242,6 +242,7 @@ - (void)testGetConfig {
CR_Config *mockConfig = OCMStrictClassMock([CR_Config class]);
OCMStub([mockConfig criteoPublisherId]).andReturn(@("1"));
+ OCMStub([mockConfig inventoryGroupId]).andReturn(@("1"));
OCMStub([mockConfig sdkVersion]).andReturn(@"1.0");
OCMStub([mockConfig appId]).andReturn(@"com.criteo.sdk.publisher");
OCMStub([mockConfig configUrl]).andReturn(@"https://url-for-getting-config");
@@ -294,6 +295,7 @@ - (void)testCdbCallContainsSdkAndProfile {
- (void)testCdbCallContainsPublisherInfo {
NSDictionary *expected = @{
CR_ApiQueryKeys.cpId : self.configMock.criteoPublisherId,
+ CR_ApiQueryKeys.inventoryGroupId : self.configMock.inventoryGroupId,
CR_ApiQueryKeys.bundleId : self.configMock.appId,
CR_ApiQueryKeys.storeId : self.configMock.storeId,
CR_ApiQueryKeys.ext : @{}
@@ -688,6 +690,7 @@ - (void)callCdbWithCompletionHandler:(CR_CdbCompletionHandler)completionHandler
- (CR_Config *)buildConfigMock {
CR_Config *mockConfig = OCMStrictClassMock([CR_Config class]);
OCMStub([mockConfig criteoPublisherId]).andReturn(@("1"));
+ OCMStub([mockConfig inventoryGroupId]).andReturn(@("1"));
OCMStub([mockConfig sdkVersion]).andReturn(@"1.0");
OCMStub([mockConfig cdbUrl]).andReturn(@"https://dummyCdb.com");
OCMStub([mockConfig path]).andReturn(@"inApp");
diff --git a/CriteoPublisherSdk/Tests/UnitTests/Network/CR_BidRequestSerializerSwiftTests.swift b/CriteoPublisherSdk/Tests/UnitTests/Network/CR_BidRequestSerializerSwiftTests.swift
index f400cf6e..da805344 100644
--- a/CriteoPublisherSdk/Tests/UnitTests/Network/CR_BidRequestSerializerSwiftTests.swift
+++ b/CriteoPublisherSdk/Tests/UnitTests/Network/CR_BidRequestSerializerSwiftTests.swift
@@ -51,6 +51,7 @@ class CR_BidRequestSerializerSwiftTests: XCTestCase {
CR_CacheAdUnit(adUnitId: "2", width: 2, height: 2)
])
config.criteoPublisherId = "Test Published Id"
+ config.inventoryGroupId = "Inventory Id"
}
func testUrl() {
@@ -77,7 +78,9 @@ class CR_BidRequestSerializerSwiftTests: XCTestCase {
func testBodyWithPublisher() {
let expected: NSDictionary = [
- NSString.bundleIdKey: config.appId, NSString.cpIdKey: config.criteoPublisherId!,
+ NSString.bundleIdKey: config.appId,
+ NSString.cpIdKey: config.criteoPublisherId!,
+ NSString.inventoryGroupIdKey: config.inventoryGroupId!,
"ext": NSDictionary()
]
let body = generateBody()
diff --git a/CriteoPublisherSdk/Tests/Utility/Categories/CR_DependencyProvider+Testing.m b/CriteoPublisherSdk/Tests/Utility/Categories/CR_DependencyProvider+Testing.m
index 1913c060..dde4ac79 100644
--- a/CriteoPublisherSdk/Tests/Utility/Categories/CR_DependencyProvider+Testing.m
+++ b/CriteoPublisherSdk/Tests/Utility/Categories/CR_DependencyProvider+Testing.m
@@ -56,6 +56,7 @@ - (NSString *)wireMockEndPoint:(NSString *)path {
- (CR_DependencyProvider *)withWireMockConfiguration {
self.config =
[[CR_Config alloc] initWithCriteoPublisherId:CriteoTestingPublisherId
+ inventoryGroupId:CriteoTestingInventoryGroupId
storeId:CriteoTestingStoreId
cdbUrl:[self wireMockEndPoint:@"cdb"]
appEventsUrl:[self wireMockEndPoint:@"gum/appevent/v1"]
diff --git a/CriteoPublisherSdk/Tests/Utility/Categories/Criteo+Testing.h b/CriteoPublisherSdk/Tests/Utility/Categories/Criteo+Testing.h
index 11b8b675..a1fa0f98 100644
--- a/CriteoPublisherSdk/Tests/Utility/Categories/Criteo+Testing.h
+++ b/CriteoPublisherSdk/Tests/Utility/Categories/Criteo+Testing.h
@@ -34,6 +34,7 @@ FOUNDATION_EXPORT NSString *const PreprodNativeAdUnitId;
FOUNDATION_EXPORT NSString *const VideoInterstitialAdUnitId;
FOUNDATION_EXPORT NSString *const RewardedAdUnitId;
FOUNDATION_EXPORT NSString *const CriteoTestingStoreId;
+FOUNDATION_EXPORT NSString *const CriteoTestingInventoryGroupId;
@interface Criteo (Testing)
/** An OCPartialMock set as an id (like in the OCMock library) for API convenience. */
diff --git a/CriteoPublisherSdk/Tests/Utility/Categories/Criteo+Testing.m b/CriteoPublisherSdk/Tests/Utility/Categories/Criteo+Testing.m
index 752f8670..6842e49c 100644
--- a/CriteoPublisherSdk/Tests/Utility/Categories/Criteo+Testing.m
+++ b/CriteoPublisherSdk/Tests/Utility/Categories/Criteo+Testing.m
@@ -34,6 +34,7 @@
// This publisherId B-056946 exists in production.
NSString *const CriteoTestingPublisherId = @"B-000001";
NSString *const CriteoTestingStoreId = @"testStoreId";
+NSString *const CriteoTestingInventoryGroupId = @"testInventoryGroupId";
NSString *const DemoBannerAdUnitId = @"30s6zt3ayypfyemwjvmp";
NSString *const DemoInterstitialAdUnitId = @"6yws53jyfjgoq1ghnuqb";
@@ -109,6 +110,7 @@ - (void)testing_registerBanner {
- (void)testing_registerWithAdUnits:(NSArray *)adUnits {
[self registerCriteoPublisherId:CriteoTestingPublisherId
+ withInventoryGroupId:CriteoTestingInventoryGroupId
withStoreId:CriteoTestingStoreId
withAdUnits:adUnits];
}
diff --git a/CriteoPublisherSdk/Tests/Utility/Categories/NSString+APIKeys.h b/CriteoPublisherSdk/Tests/Utility/Categories/NSString+APIKeys.h
index 9fe9b745..15d70591 100644
--- a/CriteoPublisherSdk/Tests/Utility/Categories/NSString+APIKeys.h
+++ b/CriteoPublisherSdk/Tests/Utility/Categories/NSString+APIKeys.h
@@ -34,6 +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 *inventoryGroupIdKey;
#pragma mark User
diff --git a/CriteoPublisherSdk/Tests/Utility/Categories/NSString+APIKeys.m b/CriteoPublisherSdk/Tests/Utility/Categories/NSString+APIKeys.m
index ec5335bb..f4de77b2 100644
--- a/CriteoPublisherSdk/Tests/Utility/Categories/NSString+APIKeys.m
+++ b/CriteoPublisherSdk/Tests/Utility/Categories/NSString+APIKeys.m
@@ -49,6 +49,10 @@ + (NSString *)cpIdKey {
return @"cpId";
}
++ (NSString *)inventoryGroupIdKey {
+ return @"inventoryGroupId";
+}
+
#pragma mark - User
+ (NSString *)userAgentKey {
diff --git a/CriteoPublisherSdk/iTestHostApp/Info.plist b/CriteoPublisherSdk/iTestHostApp/Info.plist
index 48e107a6..4d835fbe 100644
--- a/CriteoPublisherSdk/iTestHostApp/Info.plist
+++ b/CriteoPublisherSdk/iTestHostApp/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 6.2.0
+ 7.0.0
CFBundleVersion
1
LSRequiresIPhoneOS
diff --git a/Gemfile.lock b/Gemfile.lock
index d09ce280..4d9011df 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -263,7 +263,7 @@ GEM
simctl (1.6.10)
CFPropertyList
naturally
- sqlite3 (1.4.2)
+ sqlite3 (1.5.4)
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
diff --git a/Podfile.lock b/Podfile.lock
index 0f130142..82fd787d 100644
--- a/Podfile.lock
+++ b/Podfile.lock
@@ -35,6 +35,6 @@ SPEC CHECKSUMS:
OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8
SwiftLint: 06ac37e4d38c7068e0935bb30cda95f093bec761
-PODFILE CHECKSUM: 54d5470e7c2ea1832d07f974b0cd229dd19fbf3e
+PODFILE CHECKSUM: debd610e4d3856bc7ad7baafb7e5687354157485
COCOAPODS: 1.15.2