Ad Deduplication Manager
The redundancy control feature is available for advertisements (=banner/native image type/native normal type ads) that are loaded using the integrated loader (=GFPAdLoader).
Create GFPAdDedupeManager
Create an object after declaring the GFPAdDedupeManager property to manage redundancy control. numAdsDedupe refers to the number of redundancies to be controlled. It ensures non-redundant ad exposure for n consecutive ads. It is recommended to set this parameter to between 2 and 5.
- Objective-C
- Swift
@property (nonatomic, strong) GFPAdDedupeManager *dedupeManager;
var dedupeManager : GFPAdDedupeManager?
- Objective-C
- Swift
self.dedupeManager = [[GFPAdDedupeManager alloc] initWithNumAdsDeduped:3];
self.dedupeManager = GFPAdDedupeManager(numAdsDeduped: 3)
Create GFPAdLoader
Create a GFPAdLoader to load ads.
For creating a GFPAdLoader object, please refer to the guide of each advertisement.
Ad request via GFPAdDedupeManager
Requests an advertisement through GFPAdDedupeManager. When the ad is requested, the GFPAdLoader is passed as a parameter. Advertisements are requested in the order of the delivered loaders, and the success/failure of the load is transmitted to the delegate of the loader.
Redundancy control is also available for GFPAdLoader objects with different UnitIDs.
- Objective-C
- Swift
[self.dedupeManager loadAdWith:self.loader];
self.dedupeManager?.loadAd(with: self.loader)
- Objective-C
- Swift
self.loader2 = [[GFPAdLoader alloc] initWithUnitID: @"INPUT_YOUR_UNIT_ID2"
rootViewController: self
adParam: adParam];
...
self.loader2.delegate = self;
self.loader3 = [[GFPAdLoader alloc] initWithUnitID: @"INPUT_YOUR_UNIT_ID3"
rootViewController: self
adParam: adParam];
...
self.loader3.delegate = self;
[self.dedupeManager loadAdWith:self.loader2];
[self.dedupeManager loadAdWith:self.loader3];
self.loader2 = GFPAdLoader.init(unitID: "INPUT_YOUR_UNIT_ID2", rootViewController: self, adParam: adParam)
...
self.loader2.delegate = self;
self.loader3 = GFPAdLoader.init(unitID: "INPUT_YOUR_UNIT_ID3", rootViewController: self, adParam: adParam)
...
self.loader3.delegate = self;
self.dedupeManager?.loadAd(with: loader2)
self.dedupeManager?.loadAd(with: loader3)
GFPAdLoaderDelegate
When implementing GFPAdLoaderDelegate, ad-loading-related events will be available through this method.
For processing a GFPAdLoaderDelegate, please refer to the guide of each advertisement.