Menu

Advanced features

1. GDT: Behavior Incentives for Self-Rendered Native Ads

Prerequisites:

  • GDT SDK version >= 4.15.70
  • Taku SDK version >= v6.5.34
  • AnyThinkMediationGDTAdapter version > 4.15.70.0

Step 1: Integrate native ads as shown in the demo

objc Copy
......other native ad integration code


ATNativeAdOffer *offer = [[ATAdManager sharedManager] getNativeAdOfferWithPlacementID:xxx showConfig:showConfig];


//#import <GDTMobSDK/GDTMobSDK.h>
// Identify the ad platform by networkFirmID. For details, see: https://help.takuad.com/docs/2KR6QU
if (offer.networkFirmID == 8) {
id<ATNativeMaterialProtocol> nativeAd = offer.nativeAd;


if (nativeAd && [nativeAd isKindOfClass:[ATCustomNetworkNativeAd class]]) {
ATCustomNetworkNativeAd *customAd = (ATCustomNetworkNativeAd *)nativeAd;


NSDictionary *mediaExt = nil;
if ([customAd respondsToSelector:@selector(mediaExt)]) {
mediaExt = customAd.mediaExt;
}


GDTUnifiedNativeAdDataObject *obj = nil;
if ([customAd respondsToSelector:NSSelectorFromString(@"dataObj")]) {
obj = [customAd valueForKey:@"dataObj"];
}


if (mediaExt != nil && obj != nil) {
// After obtaining the mediaExt and GDTUnifiedNativeAdDataObject
// returned by the ad platform, complete the integration according
// to the GDT documentation.
}
}
}


......other native ad integration code

Step 3: After obtaining the information returned by the ad platform, complete the remaining integration according to the GDT documentation

2. Pangle: Behavior Incentives for Self-Rendered Native Ads

Notes:

  • Behavior-incentive parameters must be added to extra before calling loadAD.
  • Set rewardDelegate only for Pangle native ads.

Step 1: Integrate native ads as shown in the demo

Before calling loadAD, use extra to set the reward coin amount and required viewing duration:

objc Copy
/// Parameters passed through for Pangle native-ad incentives on the store page:
/// provide the reward coin amount and required viewing duration.
NSMutableDictionary *extra = [NSMutableDictionary dictionary];
[extra setValue:@(999) forKey:kATTTNativeECRewardGoldKey];//Param type: Integer
[extra setValue:@(5) forKey:kATTTNativeECRewardDurationKey];//Param type: Integer
[[ATAdManager sharedManager] loadADWithPlacementID:self.currentPlacementIDInfoModel.placementIDString extra:extra delegate:self];

Step 3: Set the reward callback delegate after obtaining the ATNativeAdOffer object for display

Use networkFirmID to determine whether the ad platform is Pangle. When nativeAd is an ATTTNativeObject, set rewardDelegate:

objc Copy
......other native ad integration code


ATNativeAdOffer *offer = [[ATAdManager sharedManager] getNativeAdOfferWithPlacementID:xxx showConfig:showConfig];


// Set the reward callback delegate only for Pangle native ads.
if (offer.networkFirmID == ATNetworkFirmIDTypeCSJ) {
if ([offer.nativeAd isKindOfClass:[ATTTNativeObject class]]) {
ATTTNativeObject *object = (ATTTNativeObject *)offer.nativeAd;
object.rewardDelegate = self;
}
}


......other native ad integration code

Step 4: Implement the reward event callback

Have the view controller conform to ATTTNativeRewardDelegate and implement the following method to receive behavior-incentive events:

objc Copy
#pragma mark - ATTTNativeRewardDelegate
- (void)onEventCode:(BUNativeAdEventCode)code info:(NSDictionary *)info {
ATDemoLog(@"ATNativeViewController:: onEventCode:%ld info:%@", (long)code, info);
}

Handle reward delivery, logging, or UI notifications according to your business requirements based on the callback's code and info.

Previous
Self-Rendering Shake Ads
Next
In-Stream Video Ad
Last modified: 2026-07-28Powered by