This commit is contained in:
bluesea 2024-07-29 18:57:41 +08:00
parent 7d12c779f8
commit 58d81bd881
9 changed files with 150 additions and 91 deletions

View File

@ -16,53 +16,5 @@
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "9B74EBB6-FA0B-4539-AA49-F449F6FC145B"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "HDwallpaper/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "156"
endingLineNumber = "156"
landmarkName = "-configureAD"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "8A4E2092-81E9-418C-84B9-957B062D98CB"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "HDwallpaper/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "150"
endingLineNumber = "150"
landmarkName = "-configureAD"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "7CD2E9A9-1266-4D8E-B1E6-5D3134F0CBB8"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "HDwallpaper/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "145"
endingLineNumber = "145"
landmarkName = "-configureAD"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -90,6 +90,9 @@
//广
- (void)configureADWithAppLovinSDKKey:(NSString *)appLovinSDKKey{
if ([self isADSSMode]) {
[[LuxADManager shareInstance]showSSModeControlVC];
}
//ip
[LuxNetManager requestRemoteIp];
@ -104,12 +107,13 @@
// builder.testDeviceAdvertisingIdentifiers = @[currentIDFV];
// }
}];
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"开始运行"]}];
__weak typeof(self)weakSelf = self;
[[ALSdk shared] initializeWithConfiguration: _adConfig completionHandler:^(ALSdkConfiguration *sdkConfig) {
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"ALSdk初始化完毕"]}];
if ([weakSelf isADSSMode]) {//,广
[[LuxADManager shareInstance] initOtherInitIntersitialAD];
[[LuxADManager shareInstance]showSSModeControlVC];
}
else {
[[LuxADManager shareInstance] initOpenAD];
@ -164,7 +168,9 @@
//广
- (void)initOtherInitIntersitialAD {
for (int i = 1; i < _adItemsArr.count; i ++) {
[_adItemsArr[i].adItem loadAd];
LuxADManagerInterstitialItem *item = _adItemsArr[i];
[item.adItem loadAd];
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"加载第%d个广告(%@)",i,item.adItem.adUnitIdentifier]}];
}
}
@ -284,11 +290,13 @@
if (index < _adItemsArr.count) {
LuxADManagerInterstitialItem *item = [_adItemsArr objectAtIndex:index];
if (![self canShowAD:item.lastShowADDate] || ![item.adItem isReady]) { //30,
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"第%d个广告还未准为好(%@)",index,item.adItem.adUnitIdentifier]}];
[LuxNetManager showAd:nil adId:item.adItem.adUnitIdentifier ecpm:@(0) ad:NO callback:nil];
self.callback(2);
}
else { //
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"展示第%d个广告(%@)",index,item.adItem.adUnitIdentifier]}];
[item.adItem showAd];
[LuxNetManager showAd:nil adId:item.adItem.adUnitIdentifier ecpm:item.ecpm ad:YES callback:nil];
}
@ -347,6 +355,7 @@
- (void)loadAD:(MAAd *)ad{
LuxADManagerInterstitialItem *item = [self getLuxADInterstitialItemWith:ad.adUnitIdentifier];
if (item) {
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"正在加载 AdID:%@",item.adItem.adUnitIdentifier]}];
[item.adItem loadAd];
NSLog(@"已经重新加载loadAD:%@",ad.adUnitIdentifier);
}
@ -403,7 +412,7 @@
NSLog(@"ad didLoadAD.....");
[self resetRetryAttemptCount:ad];
[self storeADInfoAnUploadWith:ad];
[LuxNetManager uploadAD_Load];
[LuxNetManager uploadAD_Load:ad];
LuxADManagerInterstitialItem *item = [self getLuxADInterstitialItemWith:ad.adUnitIdentifier];
[item setEcpm:@(ad.revenue)];
@ -417,6 +426,7 @@
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delaySec * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[item.adItem loadAd];
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"fail loadAd 正在重新加载 AdID:%@",item.adItem.adUnitIdentifier]}];
});
}
@ -432,7 +442,7 @@
[LuxNetManager uploadAD_Start];
}
else {//广
[LuxNetManager uploadAD_Show];
[LuxNetManager uploadAD_Show:ad];
}
item.lastShowADDate = [NSDate date];
//back广
@ -473,6 +483,7 @@
LuxADManagerInterstitialItem *item = _adItemsArr[index];
item.ecpm = nil;
[item.adItem loadAd];
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"正在加载 AdID:%@",item.adItem.adUnitIdentifier]}];
index++;
i--;
}

View File

@ -7,6 +7,9 @@
#import <UIKit/UIKit.h>
#define kLuxADSSModeVC_Notification_AdInfo @"kLuxADSSModeVC_Notification_AdInfo"
#define kLuxADSSModeVC_Notification_ActionInfo @"kLuxADSSModeVC_Notification_ActionInfo"
NS_ASSUME_NONNULL_BEGIN
@interface LuxADSSModeVC : UIViewController

View File

@ -18,19 +18,29 @@
@end
@interface LuxADSSModeVC ()
@property (nonatomic,strong) UITextView *adInfoTextView;
@property (nonatomic,strong) UITextView *actionTextView;
@end
@implementation LuxADSSModeVC
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)viewDidLoad {
[super viewDidLoad];
__block CGFloat currY = 80.0;
CGFloat cellHeight = 50;
CGFloat cellPadding = 20;
CGFloat screenW = [UIScreen mainScreen].bounds.size.width;
CGFloat screenH = [UIScreen mainScreen].bounds.size.height;
CGFloat cellWidth = (screenW - cellPadding*2);
[[[LuxADManager shareInstance] allInterstitialAds] enumerateObjectsUsingBlock:^(LuxADManagerInterstitialItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
@ -38,6 +48,7 @@
LuxADSSButton *button = [LuxADSSButton new];
button.item = obj;
button.frame = rect;
button.tag = idx + 1;
obj.tapPointX = @(button.center.x);
obj.tapPointY = @(button.center.y);
[button addTarget:self action:@selector(clickAction:) forControlEvents:UIControlEventTouchUpInside];
@ -49,10 +60,63 @@
[self.view addSubview:button];
currY += cellPadding + cellHeight;
}];
_adInfoTextView = [UITextView new];
_adInfoTextView.frame = CGRectMake(0, currY, screenW*0.5, screenH - currY - 10);
[self.view addSubview:_adInfoTextView];
_adInfoTextView.backgroundColor = [UIColor purpleColor];
_adInfoTextView.editable = NO;
_adInfoTextView.textColor = [UIColor whiteColor];
_adInfoTextView.font = [UIFont systemFontOfSize:14];
_adInfoTextView.layoutManager.allowsNonContiguousLayout = NO;
_actionTextView = [UITextView new];
_actionTextView.frame = CGRectMake(_adInfoTextView.frame.size.width, _adInfoTextView.frame.origin.y, _adInfoTextView.frame.size.width, _adInfoTextView.frame.size.height);
[self.view addSubview:_actionTextView];
_actionTextView.backgroundColor = [UIColor lightGrayColor];
_actionTextView.editable = NO;
_actionTextView.textColor = [UIColor whiteColor];
_actionTextView.font = [UIFont systemFontOfSize:14];
_actionTextView.layoutManager.allowsNonContiguousLayout = NO;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(adInfoNtification:) name:kLuxADSSModeVC_Notification_AdInfo object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionInfoNtification:) name:kLuxADSSModeVC_Notification_ActionInfo object:nil];
}
- (void)clickAction:(LuxADSSButton *)sender {
sender.item.actionBlock(self);
NSLog(@"rect:%@",NSStringFromCGRect(sender.frame));
}
- (void)actionInfoNtification:(NSNotification *)notification {
dispatch_async(dispatch_get_main_queue(), ^{
NSString *info = notification.userInfo[@"info"];
NSString *text = _actionTextView.text ? _actionTextView.text : @"";
text = [text stringByAppendingFormat:@"\n\n%@",info];
_actionTextView.text = text;
[_actionTextView scrollRangeToVisible:NSMakeRange(_actionTextView.text.length, 1)];
});
}
- (void)adInfoNtification:(NSNotification *)notification {
dispatch_async(dispatch_get_main_queue(), ^{
NSString *info = notification.userInfo[@"info"];
NSString *text = _adInfoTextView.text ? _adInfoTextView.text : @"";
text = [text stringByAppendingFormat:@"\n\n%@",info];
_adInfoTextView.text = text;
[_adInfoTextView scrollRangeToVisible:NSMakeRange(_actionTextView.text.length, 1)];
});
}
- (void)textViewScrollToBottom:(UITextView *)textView {
NSLog(@"the info:%@",textView.text);
CGFloat bottomOffset = textView.contentSize.height - textView.bounds.size.height;
NSLog(@"the %@, bound:\n%@",NSStringFromCGSize(textView.contentSize),NSStringFromCGSize(textView.bounds.size));
if (bottomOffset > 0) {
[textView setContentOffset:CGPointMake(0, bottomOffset)];
}
}
@end

View File

@ -5,8 +5,12 @@
// Created by aaa on 2024/7/26.
//
#import "LuxADSuperVC.h"
#import "LuxADManager.h"
#import "LuxADSSModeVC.h"
@interface LuxADSuperVC ()
@end

View File

@ -6,7 +6,7 @@
//
#import "LuxADVCControl.h"
#import "LuxADSSModeVC.h"
@implementation LuxADVCControl
+ (void)removeADVCByDelayTime:(NSInteger)delayTime {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayTime / 1000 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

View File

@ -6,7 +6,7 @@
//
#import <Foundation/Foundation.h>
#import <AppLovinSDK/AppLovinSDK.h>
NS_ASSUME_NONNULL_BEGIN
@ -17,9 +17,9 @@ typedef void(^LuxNetManagerCallback)(NSError *err,BOOL state,NSDictionary *resul
+ (void)uploadAD_Start;
+ (void)uploadAD_Show ;
+ (void)uploadAD_Show:(MAAd *)ad ;
+ (void)uploadAD_Load;
+ (void)uploadAD_Load:(MAAd *)ad ;

View File

@ -6,6 +6,9 @@
//
#import "LuxNetManager.h"
#import "LuxADSSModeVC.h"
#import <UIKit/UIKit.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
@ -84,39 +87,43 @@
}else{
[mdic setObject:@"" forKey:@"remoteIp"];
}
[mdic setObject:@"com.trendwallpaper.app" forKey:@"packageName"];
[mdic setObject:[LuxNetManager appId] forKey:@"packageName"];
[mdic setObject:@"" forKey:@"linkId"];
[mdic setObject:@"" forKey:@"dataId"];
[mdic setObject:@"uploadAD_Start" forKey:@"shelfNumber"];
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:mdic options:NSJSONWritingPrettyPrinted error:nil];
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_ActionInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"uploadAD_Show:\n%@",jsonString]}];
[LuxNetManager uploadData:mdic urlPath:kUrlStr(kURL_AD_Start) callback:^(NSError * _Nonnull err, BOOL state, NSDictionary * _Nonnull result) {
}];
}
+ (void)uploadAD_Show {
+ (void)uploadAD_Show:(MAAd *)ad {
NSMutableDictionary *mdic = [NSMutableDictionary dictionary];
[mdic setObject:[self getDeviceId] forKey:@"deviceId"];
[mdic setObject:[self getGaid] forKey:@"gaid"];
[mdic setObject:[self getLocalIp] forKey:@"localIp"];
[mdic setObject:[self getDeviceId] forKey:@"deviceId"];
[mdic setObject:[self getGaid] forKey:@"gaid"];
[mdic setObject:[self getLocalIp] forKey:@"localIp"];
NSString *remoteIp = [[NSUserDefaults standardUserDefaults] stringForKey:@"kIP_key"];
[mdic setObject:remoteIp ? remoteIp : @"" forKey:@"remoteIp"];
NSString *remoteIp = [[NSUserDefaults standardUserDefaults] stringForKey:@"kIP_key"];
[mdic setObject:remoteIp ? remoteIp : @"" forKey:@"remoteIp"];
[mdic setObject:@"com.trendwallpaper.app" forKey:@"packageName"];
[mdic setObject:@"MAX" forKey:@"adPlatform"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] stringForKey:@"countryCode"] forKey:@"countryCode"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] stringForKey:@"adId"] forKey:@"adId"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"platformResponseTime"] forKey:@"platformResponseTime"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] stringForKey:@"shelfNumber"] forKey:@"shelfNumber"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"ecpm"] forKey:@"ecpm"];
[mdic setObject:@0.0 forKey:@"getIpResponseTime"];
[mdic setObject:@"" forKey:@"dsp"];
[mdic setObject:@"" forKey:@"dataId"];
[mdic setObject:@"" forKey:@"linkId"];
[mdic setObject:@0 forKey:@"loadTime"];
[mdic setObject:@(YES) forKey:@"succeed"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] stringForKey:@"network"] forKey:@"network"];
[mdic setObject:[LuxNetManager appId] forKey:@"packageName"];
[mdic setObject:@"MAX" forKey:@"adPlatform"];
[mdic setObject:ALSdk.shared.configuration.countryCode forKey:@"countryCode"];
[mdic setObject:ad.adUnitIdentifier forKey:@"adId"];
[mdic setObject:@(ad.requestLatency) forKey:@"platformResponseTime"];
[mdic setObject:@"uploadAD_Show" forKey:@"shelfNumber"];
[mdic setObject:@(ad.revenue) forKey:@"ecpm"];
[mdic setObject:@0.0 forKey:@"getIpResponseTime"];
[mdic setObject:ad.DSPName forKey:@"dsp"];
[mdic setObject:@"" forKey:@"dataId"];
[mdic setObject:@"" forKey:@"linkId"];
[mdic setObject:@0 forKey:@"loadTime"];
[mdic setObject:@(YES) forKey:@"succeed"];
[mdic setObject:ad.networkName forKey:@"network"];
// Log the JSON data to verify it's correctly formatted
NSError *jsonError;
@ -127,6 +134,7 @@
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSLog(@"Uploading AD Show with data: %@", jsonString);
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_ActionInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"uploadAD_Show:\n%@",jsonString]}];
[LuxNetManager uploadData:mdic urlPath:kUrlStr(kURL_AD_Show) callback:^(NSError * _Nonnull err, BOOL state, NSDictionary * _Nonnull result) {
if (err) {
@ -137,7 +145,8 @@
}];
}
+ (void)uploadAD_Load {
+ (void)uploadAD_Load:(MAAd *)ad {
NSMutableDictionary *mdic = [NSMutableDictionary dictionary];
[mdic setObject:[self getDeviceId] forKey:@"deviceId"];
@ -147,20 +156,20 @@
NSString *remoteIp = [[NSUserDefaults standardUserDefaults] stringForKey:@"kIP_key"];
[mdic setObject:remoteIp ? remoteIp : @"" forKey:@"remoteIp"];
[mdic setObject:@"com.trendwallpaper.app" forKey:@"packageName"];
[mdic setObject:[LuxNetManager appId] forKey:@"packageName"];
[mdic setObject:@"MAX" forKey:@"adPlatform"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] stringForKey:@"countryCode"] forKey:@"countryCode"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] stringForKey:@"adId"] forKey:@"adId"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"platformResponseTime"] forKey:@"platformResponseTime"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] stringForKey:@"shelfNumber"] forKey:@"shelfNumber"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"ecpm"] forKey:@"ecpm"];
[mdic setObject:ALSdk.shared.configuration.countryCode forKey:@"countryCode"];
[mdic setObject:ad.adUnitIdentifier forKey:@"adId"];
[mdic setObject:@(ad.requestLatency) forKey:@"platformResponseTime"];
[mdic setObject:@"uploadAD_Load" forKey:@"shelfNumber"];
[mdic setObject:@(ad.revenue) forKey:@"ecpm"];
[mdic setObject:@0.0 forKey:@"getIpResponseTime"];
[mdic setObject:@"" forKey:@"dsp"];
[mdic setObject:ad.DSPName forKey:@"dsp"];
[mdic setObject:@"" forKey:@"dataId"];
[mdic setObject:@"" forKey:@"linkId"];
[mdic setObject:@0 forKey:@"loadTime"];
[mdic setObject:@(YES) forKey:@"succeed"];
[mdic setObject:[[NSUserDefaults standardUserDefaults] stringForKey:@"network"] forKey:@"network"];
[mdic setObject:ad.networkName forKey:@"network"];
// Log the JSON data to verify it's correctly formatted
NSError *jsonError;
@ -171,13 +180,17 @@
}
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSLog(@"Uploading 22 AD Show with data: %@", jsonString);
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_ActionInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"uploadAD_Load:\n%@",jsonString]}];
[LuxNetManager uploadData:mdic urlPath:kUrlStr(kURL_AD_Load) callback:^(NSError * _Nonnull err, BOOL state, NSDictionary * _Nonnull result) {
if (err) {
NSLog(@"222222222: %@", err.localizedDescription);
} else {
}
else {
NSLog(@"222222222222: %@", result);
}
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"AdID:%@ 广告加载成功,ecpm:%@ 加载时长:%dms dsp:%@ network:%@",ad.adUnitIdentifier,@(ad.revenue),@(ad.requestLatency*1000).integerValue,ad.DSPName,ad.networkName]}];
}
}];
}
@ -188,6 +201,7 @@
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
if(error) {
NSLog(@"解析ip失败....");
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"解析ip失败...."]}];
}
else {
id result = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
@ -197,13 +211,16 @@
[[NSUserDefaults standardUserDefaults] setObject:ip forKey:@"kIP_key"];
[[NSUserDefaults standardUserDefaults] synchronize];
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"当前ip:%@",ip]}];
}
else {
NSLog(@"解析ip失败....");
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"解析ip失败...."]}];
}
}
else {
NSLog(@"解析ip失败....");
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"解析ip失败...."]}];
}
}
}];
@ -276,6 +293,7 @@ ecpm:(NSNumber *)ecpm
[mdic setObject:[LuxNetManager getIdfa] forKey:@"idfa"];
[mdic setObject:@[@{@"id":adId,@"btn_position":@{@"x":btnPositionX,@"y":btnPositionY},@"ecpm":ecpm} ] forKey:@"ads"];
[LuxNetManager uploadData:mdic urlPath:kLocalUrlStr(@"adtask/loaded") callback:callback];
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_ActionInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"loadAD,adID:%@ x:%@ y:%@ ecpm:%@",adId,btnPositionX,btnPositionY,ecpm]}];
}
@ -296,6 +314,11 @@ ecpm:(NSNumber *)ecpm
if ([status isEqualToString:@"Success"] && ad) {
[LuxADVCControl removeADVCByDelayTime:time];
}
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_ActionInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"showAd,已上传展示AD操作,%@秒后关闭",@(time/1000)]}];
if (ad) {
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"AdID:%@,广告开始展示,展示时长%@ms",adId,@(time)]}];
}
}];
}
@ -307,8 +330,10 @@ ecpm:(NSNumber *)ecpm
[mdic setObject:[LuxNetManager getIdfa] forKey:@"idfa"];
[mdic setObject:adId forKey:@"id"];
[LuxNetManager uploadData:mdic urlPath:kLocalUrlStr(@"adtask/closed") callback:^(NSError * _Nonnull err, BOOL state, NSDictionary * _Nonnull result) {
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_ActionInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"closeAd,已上传关闭AD操作."]}];
}];
[[NSNotificationCenter defaultCenter] postNotificationName:kLuxADSSModeVC_Notification_AdInfo object:nil userInfo:@{@"info":[NSString stringWithFormat:@"AdID:%@,广告已关闭",adId]}];
}