Skip to main content

Custom AdChoices

A feature that has been added in GFP SDK version 6.5.0. It supports the customization of the screen that appears when clicking on the GFPAdChoicesView of an S2S native advertisement.

info

When using customized Ad Choices, the Ad Choices icon must be manually configured in the UI as Ad Choices icons are not rendered in GFPAdChoicesView.

info

This feature is not processed by native ads from C2S ad providers such as DFP, FAN, or InMobi.

enableCustomAdChoices

Set whether to use custom for the native advertising AdChoices view. (Default: NO) When setting this option, sdk does not display a view under adChoicesView.

GFPAdNativeOptions *nativeOptions = [[GFPAdNativeOptions alloc] init];

GFPNativeAdRenderingSetting *renderingSetting = [[GFPNativeAdRenderingSetting alloc] init];
renderingSetting.enableCustomAdChoices = NO; (기본값)
renderingSetting.enableCustomAdChoices = YES;

nativeOptions.renderingSetting = renderingSetting;

AdChoices Data

Data can be obtained through adChoicesData of nativeAd. Data will only be available when enableCustomAdChoices is enabled, and it will only be provided for s2s ads with adChoices information.

GFPAdChoicesData provides type, adMuteData, and privacyUrl.

type

  • AdMute: When only adMuteData exists
  • Privacy: When only privacyUrl exists
  • OptOut: When both adMuteData + privacyUrl exist

adMuteData

If adMuteData exists, the mute reason will be rendered based on adMuteData. When clicked, reportClickWith: must be called.

GFPAdMuteData provides reasonCodes and textWith:, textWith:languageType:, resourceIdWith:, and reportClickWith:.

reasonCodes

reasonCodes is a key value for the adMute reason and is used for text/resource ID search and click reporting.

GFPAdMuteData *adMuteData = nativeAd.adChoicesData.adMuteData;

[adMuteData.reasonCodes enumerateObjectsUsingBlock:^(NSString * _Nonnull reasonCode, NSUInteger idx, BOOL * _Nonnull stop) {
NSLog(@"adMuteReason: code - %@", reasonCode);
}];

adMute 사유

The text reason can be searched by transmitting reasonCode as a parameter.

Return text that matches the device's language settings when searching for reasons with textWith.

GFPAdMuteData *adMuteData = nativeAd.adChoicesData.adMuteData;

[adMuteData.reasonCodes enumerateObjectsUsingBlock:^(NSString * _Nonnull reasonCode, NSUInteger idx, BOOL * _Nonnull stop) {
NSString *reasonText = [adMuteData textWith:reasonCode];
NSLog(@"adMuteReason: reasonText - %@", reasonCode);
}];

When searching for a reason using textWith:, text corresponding to the languageType will be returned. The supported languages are Korean, English, Spanish, French, Indonesian, Thai, and Hong Kong/Taiwanese.

GFPAdMuteData *adMuteData = nativeAd.adChoicesData.adMuteData;

[adMuteData.reasonCodes enumerateObjectsUsingBlock:^(NSString * _Nonnull reasonCode, NSUInteger idx, BOOL * _Nonnull stop) {
NSString *reasonText_ko = [adMuteData textWith:reasonCode languageType:GFPNativeLanguageType_ko];
NSLog(@"adMuteReason: reasonText_ko - %@", reasonCode, reasonText_ko);
}];

reportClickWith:

When adMute reason is clicked, reasonCode is transmitted as a parameter notifying that it has been clicked.

GFPAdMuteData *adMuteData = nativeAd.adChoicesData.adMuteData;
[adMuteData reportClickWith:reasonCode];

privacyUrl

In the event that privacyUrl exists, the privacy icon must be rendered. When clicked, it must be landed on a privacyUrl.