Skip to main content

Other Function Introduction

1.Turn off and trigger expiration detection#

  • Called after the ad slot object is created, these two methods are valid for global settings.
  • To prevent supplementary expired advertisements from occupying bandwidth during the game,you can callisExpiredAdChecking,and turnNOoff automatic expiration detection every 5 minutes. By defaultYES,ad expiration detection will be performed automatically.
  • If expiration detection is turned off, it can be calledexpiredAdCheckto trigger an ad expiration detection.
// Turn off automatic expiration detection every 5 minutes
// YES=Allow scheduled checks NO=Turn off scheduled checks The default is YES
[TradPlus sharedInstance].isExpiredAdChecking = BOOLg = BOOL
// Can actively trigger expiration detection (if there is an invalid advertisement, it will trigger loading)
[TradPlus expiredAdCheck];

2.Only use TradPlus domestic domain name servers#

  • V6.8 has a new API ,which can be called before initializing the SDK
////After this interface is set to Yes, the SDK will only use the TradPlus domestic domain name server. The default is NO
[TradPlus setCnServer:BOOL];

3.Use local configuration information#

Developers can pass in local configuration through this interface, and the corresponding advertising slot will give priority to using this local configuration to request ads when loading for the first time.

/// Set local configuration information
/// @param configInfo local configuration
/// @param placementId Advertising slot ID
[TradPlus setLocalConfig:config placementId:self.placementId]

4.Set up custom display AdInfo#

Developers can load classcustomAdInfosetting data for each ad before displaying the ad. The SDK will return in the relevant callback after the presentation.

//Take incentive video as an example:
//Set before display
self.rewardedVideoAd.customAdInfo = @{@"act":@"Show",@"time":@(time)};
[self.rewardedVideoAd showAdWithSceneId:@"scene_id"];

5.Set the global display callback of the application dimension#

v8.5.0+ In order to facilitate developers to perform display data statistics, the SDK provides a global display callback API

#import <TradPlusAds/TradPlus.h>
[TradPlus sharedInstance].impressionDelegate = self;
#pragma mark - TradPlusAdImpressionDelegate
- (void)tradPlusAdImpression:(NSDictionary *)adInfo
{
//Developers can obtain the display callbacks of all ad slots through this callback
}

For related fields in adInfo(NSDictionary), please refer to: Callback information Description

6.Set UID2 (v9.8.0+)#

  • It is recommended to set it before initializing TPSDK
  • If you have obtained the UID2Token by yourself, you can also set it according to the following code
TradPlusUID2Info *UID2Info = [[TradPlusUID2Info alloc] init];
UID2Info.UID2Token = @"your UID2Token";
[[TradPlus sharedInstance] setUID2Info:UID2Info];

7.Turn off the "last round of loading failed, no further loading within 10s" advertising mechanism (v10.0.0+)#

  • Starting from v10.0.0, it can be set through the local parameter interface before loading the advertisement.
[TradPlus sharedInstance].settingDataParam = @{ @"limit_reload_close":@(YES) };

8.Turn off flip display ad source information#

  • Function introduction: When the advertisement is displayed, quickly flip the phone twice, and the TradPlus logo will appear on the edge of the screen. Click on the logo to see relevant information about the display advertising source, which is convenient for quickly locating the problem.
#import <TradPlusAds/TPAdInfoHandler.h>
[TPAdInfoHandler sharedInstance].close = YES;