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 call
isExpiredAdChecking
,and turnNO
off automatic expiration detection every 5 minutes. By defaultYES
,ad expiration detection will be performed automatically. - If expiration detection is turned off, it can be called
expiredAdCheck
to 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 classcustomAdInfo
setting 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.Set the display limit of the Ad platform (per day)
- v13.1.0+
Setting rules
#import <TradPlusAds/TradPlus.h>
TPPlatformLimit *limit = [[TPPlatformLimit alloc] init];
[limit setLimitWithPlatformID:TPPlatformID_Admob. num:1];
[limit setLimitWithPlatformID:TPPlatformID_Mintegral. num:2];
//Pass in limit.list to set rules
[TradPlus setPlatformLimit:limit.list];
Clear rules
#import <TradPlusAds/TradPlus.h>
//Pass in an empty array to clear the rules
[TradPlus setPlatformLimit:@[]];
Directly pass in rule data
#import <TradPlusAds/TradPlus.h>
NSArray *array = @[@{@"platform":@(TPPlatformID_Admob),@"num":@(1)},@{@"platform":@(TPPlatformID_Mintegral),@"num":@(2)}];
[TradPlus setPlatformLimit:array];