Commit 4c90aa55 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

ads

parent e51b0931
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<key>GYDemo.xcscheme_^#shared#^_</key> <key>GYDemo.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>10</integer> <integer>9</integer>
</dict> </dict>
</dict> </dict>
<key>SuppressBuildableAutocreation</key> <key>SuppressBuildableAutocreation</key>
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#import "GYOpenBoxModel.h" #import "GYOpenBoxModel.h"
#import "GYGiftAlertView.h" #import "GYGiftAlertView.h"
#import <UMCommon/UMCommon.h> #import <UMCommon/UMCommon.h>
#import "GYSettingViewController.h"
UnityFramework* UnityFrameworkLoad() UnityFramework* UnityFrameworkLoad()
{ {
...@@ -153,6 +154,7 @@ NSDictionary* appLaunchOpts; ...@@ -153,6 +154,7 @@ NSDictionary* appLaunchOpts;
// 跳转幸运转盘 // 跳转幸运转盘
- (void)ios_luckyTurntable { - (void)ios_luckyTurntable {
GYWheelSurfViewController * wheel = [[UIStoryboard storyboardWithName:@"GYNative" bundle:nil] instantiateViewControllerWithIdentifier:@"GYWheelSurfViewController"]; GYWheelSurfViewController * wheel = [[UIStoryboard storyboardWithName:@"GYNative" bundle:nil] instantiateViewControllerWithIdentifier:@"GYWheelSurfViewController"];
wheel.modalPresentationStyle = UIModalPresentationFullScreen; wheel.modalPresentationStyle = UIModalPresentationFullScreen;
[[[self ufw] appController].window.rootViewController presentViewController:wheel animated:true completion:nil]; [[[self ufw] appController].window.rootViewController presentViewController:wheel animated:true completion:nil];
...@@ -162,7 +164,7 @@ NSDictionary* appLaunchOpts; ...@@ -162,7 +164,7 @@ NSDictionary* appLaunchOpts;
- (void)ios_getCoin { - (void)ios_getCoin {
if (_showTask == YES) { if (_showTask == YES) {
return;; return;
} }
_showTask = YES; _showTask = YES;
...@@ -228,7 +230,9 @@ NSDictionary* appLaunchOpts; ...@@ -228,7 +230,9 @@ NSDictionary* appLaunchOpts;
- (void)ios_adFlyBox { - (void)ios_adFlyBox {
if (self.showVideo == YES) { if (self.showVideo == YES) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[GYAdsManager shared] play]; [[GYAdsManager shared] play];
});
return; return;
} }
...@@ -256,7 +260,6 @@ NSDictionary* appLaunchOpts; ...@@ -256,7 +260,6 @@ NSDictionary* appLaunchOpts;
} failure:^(NSError * _Nonnull error) { } failure:^(NSError * _Nonnull error) {
}]; }];
} }
// 数据埋点 // 数据埋点
...@@ -322,7 +325,7 @@ NSDictionary* appLaunchOpts; ...@@ -322,7 +325,7 @@ NSDictionary* appLaunchOpts;
NSString *status = [[CGUserManager shared].appSwitch[@"isopenH5"] stringValue]; NSString *status = [[CGUserManager shared].appSwitch[@"isopenH5"] stringValue];
NSLog(@"isopenH5 = %@", status); NSLog(@"isopenH5 = %@", status);
if (status.length > 0) { if (status.length > 0) {
[[self ufw] sendMessageToGOWithName: "GameManager" functionName: "showMoreInfo" message: [status UTF8String]]; [[self ufw] sendMessageToGOWithName: "GameManager" functionName: "showMoreInfo" message: [@"1" UTF8String]];
} }
[[CGNetworkTools shared] getWithAction: getPlaceList parameters: @{} success:^(id _Nonnull response) { [[CGNetworkTools shared] getWithAction: getPlaceList parameters: @{} success:^(id _Nonnull response) {
...@@ -592,7 +595,6 @@ NSDictionary* appLaunchOpts; ...@@ -592,7 +595,6 @@ NSDictionary* appLaunchOpts;
// set quit handler to change default behavior of exit app // set quit handler to change default behavior of exit app
[[self ufw] appController].quitHandler = ^(){ NSLog(@"AppController.quitHandler called"); }; [[self ufw] appController].quitHandler = ^(){ NSLog(@"AppController.quitHandler called"); };
} }
- (void)applicationWillResignActive:(UIApplication *)application { - (void)applicationWillResignActive:(UIApplication *)application {
...@@ -618,6 +620,10 @@ NSDictionary* appLaunchOpts; ...@@ -618,6 +620,10 @@ NSDictionary* appLaunchOpts;
return [WXApi handleOpenURL:url delegate:self]; return [WXApi handleOpenURL:url delegate:self];
} }
-(BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler{
return [WXApi handleOpenUniversalLink:userActivity delegate:self];
}
-(void)sendAuthRequest{ -(void)sendAuthRequest{
// //构造SendAuthReq结构体 // //构造SendAuthReq结构体
// SendAuthReq* req = [[SendAuthReq alloc] init]; // SendAuthReq* req = [[SendAuthReq alloc] init];
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define WXAppId @"wx007d3159b1e66018" #define WXAppId @"wx007d3159b1e66018"
#define WXAppSecret @"d8c8c1f6479f8f6ea22d0b3d24f04087" #define WXAppSecret @"d8c8c1f6479f8f6ea22d0b3d24f04087"
#define WXUniversalLink @"https://feedapi.clouddistribute.net/LuckFarm/" #define WXUniversalLink @"https://feedapi.clouddistribute.net/LuckFarm/"
#define WXLoginState @"Wha" #define WXLoginState @"WTF"
#define WXLoginName @"WXLogin" #define WXLoginName @"WXLogin"
#define UMAppkey @"5f966f0d45b2b751a91b6012" #define UMAppkey @"5f966f0d45b2b751a91b6012"
......
This diff is collapsed.
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
CGRect frame = [UIScreen mainScreen].bounds; CGRect frame = [UIScreen mainScreen].bounds;
self.splashAd_CSJ = [[BUSplashAdView alloc] initWithSlotID:model.codeId frame:frame]; self.splashAd_CSJ = [[BUSplashAdView alloc] initWithSlotID:model.codeId frame:frame];
self.splashAd_CSJ.tolerateTimeout = 10; // self.splashAd_CSJ.tolerateTimeout = 10;
self.splashAd_CSJ.delegate = self; self.splashAd_CSJ.delegate = self;
[self.splashAd_CSJ loadAdData]; [self.splashAd_CSJ loadAdData];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
- (void)openScreenAdsForGDT:(GYAdsTrackModel *)model{ - (void)openScreenAdsForGDT:(GYAdsTrackModel *)model{
self.splashAd_GDT = [[GDTSplashAd alloc] initWithPlacementId:model.codeId]; self.splashAd_GDT = [[GDTSplashAd alloc] initWithPlacementId:model.codeId];
self.splashAd_GDT.delegate = self; self.splashAd_GDT.delegate = self;
self.splashAd_GDT.fetchDelay = 5; // self.splashAd_GDT.fetchDelay = 5;
self.splashAd_GDT.backgroundImage = [UIImage imageNamed:@""]; self.splashAd_GDT.backgroundImage = [UIImage imageNamed:@""];
self.splashAd_GDT.backgroundImage.accessibilityIdentifier = @"splash_ad"; self.splashAd_GDT.backgroundImage.accessibilityIdentifier = @"splash_ad";
[self.splashAd_GDT loadAd]; [self.splashAd_GDT loadAd];
...@@ -95,29 +95,29 @@ ...@@ -95,29 +95,29 @@
- (void)splashAdWillVisible:(BUSplashAdView *)splashAd { - (void)splashAdWillVisible:(BUSplashAdView *)splashAd {
[MobClick event:@"splash_display" label:@"splash_display_success"]; [MobClick event:@"splash_display" label:@"splash_display_success"];
// NSString * clkTracking = self.currentAdsModel.imp_tracking[0]; NSString * clkTracking = self.currentAdsModel.imp_tracking[0];
// if (clkTracking.length > 0) { if (clkTracking.length > 0) {
// [[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) { [[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
//
// } failure:^(NSError * _Nonnull error) { } failure:^(NSError * _Nonnull error) {
//
// }]; }];
// } }
} }
- (void)splashAdDidClick:(BUSplashAdView *)splashAd { - (void)splashAdDidClick:(BUSplashAdView *)splashAd {
// NSString * clkTracking = self.currentAdsModel.clk_tracking[0]; NSString * clkTracking = self.currentAdsModel.clk_tracking[0];
// if ([self.clk_tracking isEqualToString:clkTracking]) { if ([self.clk_tracking isEqualToString:clkTracking]) {
// return; return;
// } }
// if (clkTracking.length > 0) { if (clkTracking.length > 0) {
// [[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) { [[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
// self.clk_tracking = clkTracking; self.clk_tracking = clkTracking;
// } failure:^(NSError * _Nonnull error) { } failure:^(NSError * _Nonnull error) {
//
// }]; }];
// } }
} }
#pragma mark - GDTSplashAdDelegate #pragma mark - GDTSplashAdDelegate
...@@ -129,6 +129,14 @@ ...@@ -129,6 +129,14 @@
{ {
NSLog(@"%s",__FUNCTION__); NSLog(@"%s",__FUNCTION__);
[MobClick event:@"splash_display" label:@"splash_display_success"]; [MobClick event:@"splash_display" label:@"splash_display_success"];
NSString * clkTracking = self.currentAdsModel.imp_tracking[0];
if (clkTracking.length > 0) {
[[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
}
} }
- (void)splashAdFailToPresent:(GDTSplashAd *)splashAd withError:(NSError *)error - (void)splashAdFailToPresent:(GDTSplashAd *)splashAd withError:(NSError *)error
...@@ -147,6 +155,17 @@ ...@@ -147,6 +155,17 @@
- (void)splashAdClicked:(GDTSplashAd *)splashAd - (void)splashAdClicked:(GDTSplashAd *)splashAd
{ {
NSLog(@"%s",__FUNCTION__); NSLog(@"%s",__FUNCTION__);
NSString * clkTracking = self.currentAdsModel.clk_tracking[0];
if ([self.clk_tracking isEqualToString:clkTracking]) {
return;
}
if (clkTracking.length > 0) {
[[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
self.clk_tracking = clkTracking;
} failure:^(NSError * _Nonnull error) {
}];
}
} }
- (void)splashAdApplicationWillEnterBackground:(GDTSplashAd *)splashAd - (void)splashAdApplicationWillEnterBackground:(GDTSplashAd *)splashAd
...@@ -197,11 +216,30 @@ ...@@ -197,11 +216,30 @@
//开屏点击 //开屏点击
- (void)ksad_splashAdClicked { - (void)ksad_splashAdClicked {
NSLog(@"----%@", NSStringFromSelector(_cmd)); NSLog(@"----%@", NSStringFromSelector(_cmd));
NSString * clkTracking = self.currentAdsModel.clk_tracking[0];
if ([self.clk_tracking isEqualToString:clkTracking]) {
return;
}
if (clkTracking.length > 0) {
[[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
self.clk_tracking = clkTracking;
} failure:^(NSError * _Nonnull error) {
}];
}
} }
//开屏展示 //开屏展示
- (void)ksad_splashAdDidShow { - (void)ksad_splashAdDidShow {
NSLog(@"----%@", NSStringFromSelector(_cmd)); NSLog(@"----%@", NSStringFromSelector(_cmd));
[MobClick event:@"splash_display" label:@"splash_display_success"]; [MobClick event:@"splash_display" label:@"splash_display_success"];
NSString * clkTracking = self.currentAdsModel.imp_tracking[0];
if (clkTracking.length > 0) {
[[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
}
} }
//开屏⼴广告开始播放 //开屏⼴广告开始播放
- (void)ksad_splashAdVideoDidStartPlay { - (void)ksad_splashAdVideoDidStartPlay {
......
...@@ -42,25 +42,20 @@ ...@@ -42,25 +42,20 @@
} }
- (void)videoForCSJ:(GYAdsTrackModel *)model{ - (void)videoForCSJ:(GYAdsTrackModel *)model{
[MBProgressHUD show];
BURewardedVideoModel * rewardedModel = [[BURewardedVideoModel alloc] init]; BURewardedVideoModel * rewardedModel = [[BURewardedVideoModel alloc] init];
rewardedModel.userId = @"123"; rewardedModel.userId = @"123";
self.rewardedAd = [[BUNativeExpressRewardedVideoAd alloc] initWithSlotID:model.codeId rewardedVideoModel:rewardedModel]; self.rewardedAd = [[BUNativeExpressRewardedVideoAd alloc] initWithSlotID:model.codeId rewardedVideoModel:rewardedModel];
self.rewardedAd.delegate = self; self.rewardedAd.delegate = self;
[self.rewardedAd loadAdData]; [self.rewardedAd loadAdData];
// BURewardedVideoModel *rewardedModel = [[BURewardedVideoModel alloc] init];
// rewardedModel.userId = @"123";
// self.rewardedAd_CSJ = [[BURewardedVideoAd alloc] initWithSlotID:model.codeId rewardedVideoModel:rewardedModel];
// self.rewardedAd_CSJ.delegate = self;
// [self.rewardedAd_CSJ loadAdData];
if (self.adsFinishCallBack) { if (self.adsFinishCallBack) {
self.adsFinishCallBack(true, [UIView new]); self.adsFinishCallBack(true, [UIView new]);
} }
} }
- (void)videoForKS:(GYAdsTrackModel *)model{ - (void)videoForKS:(GYAdsTrackModel *)model{
[MBProgressHUD show];
// 激励视频广告 // 激励视频广告
self.rewardedVideoAd = [[KSRewardedVideoAd alloc] initWithPosId:model.codeId rewardedVideoModel:[KSRewardedVideoModel new]]; self.rewardedVideoAd = [[KSRewardedVideoAd alloc] initWithPosId:model.codeId rewardedVideoModel:[KSRewardedVideoModel new]];
self.rewardedVideoAd.delegate = self; self.rewardedVideoAd.delegate = self;
...@@ -72,6 +67,8 @@ ...@@ -72,6 +67,8 @@
} }
- (void)videoForGDT:(GYAdsTrackModel *)model{ - (void)videoForGDT:(GYAdsTrackModel *)model{
[MBProgressHUD show];
self.rewardVideoAd = [[GDTRewardVideoAd alloc] initWithPlacementId:model.codeId]; self.rewardVideoAd = [[GDTRewardVideoAd alloc] initWithPlacementId:model.codeId];
self.rewardVideoAd.videoMuted = YES; self.rewardVideoAd.videoMuted = YES;
self.rewardVideoAd.delegate = self; self.rewardVideoAd.delegate = self;
...@@ -107,17 +104,14 @@ ...@@ -107,17 +104,14 @@
dispatch_source_set_timer(self.CSJTimer, dispatch_walltime(NULL, 0), 1.0*NSEC_PER_SEC, 0); //每秒执行 dispatch_source_set_timer(self.CSJTimer, dispatch_walltime(NULL, 0), 1.0*NSEC_PER_SEC, 0); //每秒执行
dispatch_source_set_event_handler(self.CSJTimer, ^{ dispatch_source_set_event_handler(self.CSJTimer, ^{
// if (!self.rewardedAd.isAdValid) { if (!self.rewardedAd.isAdValid) {
// [self playVideo]; // [self playVideo];
// }else{ }else{
dispatch_source_cancel(self.CSJTimer); dispatch_source_cancel(self.CSJTimer);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
BOOL show = [self.rewardedAd showAdFromRootViewController:[self theTopviewControler]]; [self.rewardedAd showAdFromRootViewController:[self theTopviewControler]];
NSLog(@"%ld", show);
}); });
// } }
}); });
dispatch_resume(self.CSJTimer); dispatch_resume(self.CSJTimer);
...@@ -129,10 +123,15 @@ ...@@ -129,10 +123,15 @@
self.GDTTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); self.GDTTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
dispatch_source_set_timer(self.GDTTimer, dispatch_walltime(NULL, 0), 1.0*NSEC_PER_SEC, 0); //每秒执行 dispatch_source_set_timer(self.GDTTimer, dispatch_walltime(NULL, 0), 1.0*NSEC_PER_SEC, 0); //每秒执行
dispatch_source_set_event_handler(self.GDTTimer, ^{ dispatch_source_set_event_handler(self.GDTTimer, ^{
// if (!self.rewardVideoAd.adValid) { if (!self.rewardVideoAd.adValid) {
// [self playVideo]; // [self playVideo];
// }else{ if (count > 2) {
// if (count > 0) { [MobClick event:@"reward_display" label:@"reward_display_failed"];
dispatch_source_cancel(self.GDTTimer);
self.videoIndex += 1;
[self videoPrepareModel];
}
}else{
dispatch_source_cancel(self.GDTTimer); dispatch_source_cancel(self.GDTTimer);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
BOOL show = [self.rewardVideoAd showAdFromRootViewController:self.currentVC]; BOOL show = [self.rewardVideoAd showAdFromRootViewController:self.currentVC];
...@@ -143,14 +142,13 @@ ...@@ -143,14 +142,13 @@
return; return;
} }
if (self.rewardVideoAd.videoMuted) { if (self.rewardVideoAd.videoMuted) {
[[AVAudioSession sharedInstance] setActive:NO error:nil]; // [[AVAudioSession sharedInstance] setActive:NO error:nil];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; // [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil]; // [[AVAudioSession sharedInstance] setActive:YES error:nil];
} }
}); });
// } }
count ++; count ++;
// }
}); });
dispatch_resume(self.GDTTimer); dispatch_resume(self.GDTTimer);
...@@ -172,13 +170,24 @@ ...@@ -172,13 +170,24 @@
dispatch_source_cancel(self.CSJTimer); dispatch_source_cancel(self.CSJTimer);
} }
// [rewardedVideoAd showAdFromRootViewController:self.currentVC]; // [rewardedVideoAd showAdFromRootViewController:self.currentVC];
[MBProgressHUD hideHUD];
[MobClick event:@"reward_display" label:@"reward_display_success"]; [MobClick event:@"reward_display" label:@"reward_display_success"];
NSString * clkTracking = self.currentAdsModel.imp_tracking[0];
if (clkTracking.length > 0) {
[[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
}
} }
/** /**
This method is called when video ad materia failed to load. This method is called when video ad materia failed to load.
@param error : the reason of error @param error : the reason of error
*/ */
- (void)nativeExpressRewardedVideoAd:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error{ - (void)nativeExpressRewardedVideoAd:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error{
[MBProgressHUD hideHUD];
[MobClick event:@"reward_display" label:@"reward_display_failed"]; [MobClick event:@"reward_display" label:@"reward_display_failed"];
dispatch_source_cancel(self.CSJTimer); dispatch_source_cancel(self.CSJTimer);
self.videoIndex += 1; self.videoIndex += 1;
...@@ -242,7 +251,17 @@ This method is called when video ad is closed. ...@@ -242,7 +251,17 @@ This method is called when video ad is closed.
This method is called when video ad is clicked. This method is called when video ad is clicked.
*/ */
- (void)nativeExpressRewardedVideoAdDidClick:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd{ - (void)nativeExpressRewardedVideoAdDidClick:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd{
NSString * clkTracking = self.currentAdsModel.clk_tracking[0];
if ([self.clk_tracking isEqualToString:clkTracking]) {
return;
}
if (clkTracking.length > 0) {
[[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
self.clk_tracking = clkTracking;
} failure:^(NSError * _Nonnull error) {
}];
}
} }
/** /**
This method is called when the user clicked skip button. This method is called when the user clicked skip button.
...@@ -290,6 +309,7 @@ This method is called when another controller has been closed. ...@@ -290,6 +309,7 @@ This method is called when another controller has been closed.
// NSString *text = [NSString stringWithFormat:@"视频资源加载失败:error:%@", error]; // NSString *text = [NSString stringWithFormat:@"视频资源加载失败:error:%@", error];
// [MBProgressHUD showWarningHudToKeyWindowWithText:text]; // [MBProgressHUD showWarningHudToKeyWindowWithText:text];
// [MBProgressHUD showWarningHudToKeyWindowWithText:NSStringFromSelector(_cmd)]; // [MBProgressHUD showWarningHudToKeyWindowWithText:NSStringFromSelector(_cmd)];
[MBProgressHUD hideHUD];
[MobClick event:@"reward_display" label:@"reward_display_failed"]; [MobClick event:@"reward_display" label:@"reward_display_failed"];
self.videoIndex += 1; self.videoIndex += 1;
[self videoPrepareModel]; [self videoPrepareModel];
...@@ -302,7 +322,16 @@ This method is called when another controller has been closed. ...@@ -302,7 +322,16 @@ This method is called when another controller has been closed.
// 这里能获取到ecpm // 这里能获取到ecpm
NSInteger ecpm = rewardedVideoAd.ecpm; NSInteger ecpm = rewardedVideoAd.ecpm;
NSLog(@"ecpm:%zd", (long)ecpm); NSLog(@"ecpm:%zd", (long)ecpm);
[MBProgressHUD hideHUD];
[MobClick event:@"reward_display" label:@"reward_display_success"]; [MobClick event:@"reward_display" label:@"reward_display_success"];
NSString * clkTracking = self.currentAdsModel.imp_tracking[0];
if (clkTracking.length > 0) {
[[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
}
} }
- (void)rewardedVideoAdWillVisible:(KSRewardedVideoAd *)rewardedVideoAd { - (void)rewardedVideoAdWillVisible:(KSRewardedVideoAd *)rewardedVideoAd {
...@@ -332,6 +361,18 @@ This method is called when another controller has been closed. ...@@ -332,6 +361,18 @@ This method is called when another controller has been closed.
- (void)rewardedVideoAdDidClick:(KSRewardedVideoAd *)rewardedVideoAd { - (void)rewardedVideoAdDidClick:(KSRewardedVideoAd *)rewardedVideoAd {
// NSLog(@"%@", NSStringFromSelector(_cmd)); // NSLog(@"%@", NSStringFromSelector(_cmd));
// [MBProgressHUD showWarningHudToKeyWindowWithText:NSStringFromSelector(_cmd)]; // [MBProgressHUD showWarningHudToKeyWindowWithText:NSStringFromSelector(_cmd)];
NSString * clkTracking = self.currentAdsModel.clk_tracking[0];
if ([self.clk_tracking isEqualToString:clkTracking]) {
return;
}
if (clkTracking.length > 0) {
[[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
self.clk_tracking = clkTracking;
} failure:^(NSError * _Nonnull error) {
}];
}
} }
- (void)rewardedVideoAdDidPlayFinish:(KSRewardedVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error { - (void)rewardedVideoAdDidPlayFinish:(KSRewardedVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error {
...@@ -362,8 +403,16 @@ This method is called when another controller has been closed. ...@@ -362,8 +403,16 @@ This method is called when another controller has been closed.
NSLog(@"eCPM:%ld eCPMLevel:%@", [rewardedVideoAd eCPM], [rewardedVideoAd eCPMLevel]); NSLog(@"eCPM:%ld eCPMLevel:%@", [rewardedVideoAd eCPM], [rewardedVideoAd eCPMLevel]);
NSLog(@"videoDuration :%lf rewardAdType:%ld", rewardedVideoAd.videoDuration, rewardedVideoAd.rewardAdType); NSLog(@"videoDuration :%lf rewardAdType:%ld", rewardedVideoAd.videoDuration, rewardedVideoAd.rewardAdType);
// dispatch_source_cancel(self.GDTTimer); [MBProgressHUD hideHUD];
[MobClick event:@"reward_display" label:@"reward_display_success"]; [MobClick event:@"reward_display" label:@"reward_display_success"];
NSString * clkTracking = self.currentAdsModel.imp_tracking[0];
if (clkTracking.length > 0) {
[[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
}
} }
- (void)gdt_rewardVideoAdVideoDidLoad:(GDTRewardVideoAd *)rewardedVideoAd - (void)gdt_rewardVideoAdVideoDidLoad:(GDTRewardVideoAd *)rewardedVideoAd
...@@ -399,6 +448,18 @@ This method is called when another controller has been closed. ...@@ -399,6 +448,18 @@ This method is called when another controller has been closed.
{ {
NSLog(@"%s",__FUNCTION__); NSLog(@"%s",__FUNCTION__);
NSLog(@"广告已点击"); NSLog(@"广告已点击");
NSString * clkTracking = self.currentAdsModel.clk_tracking[0];
if ([self.clk_tracking isEqualToString:clkTracking]) {
return;
}
if (clkTracking.length > 0) {
[[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
self.clk_tracking = clkTracking;
} failure:^(NSError * _Nonnull error) {
}];
}
} }
- (void)gdt_rewardVideoAd:(GDTRewardVideoAd *)rewardedVideoAd didFailWithError:(NSError *)error - (void)gdt_rewardVideoAd:(GDTRewardVideoAd *)rewardedVideoAd didFailWithError:(NSError *)error
...@@ -427,6 +488,7 @@ This method is called when another controller has been closed. ...@@ -427,6 +488,7 @@ This method is called when another controller has been closed.
} }
NSLog(@"ERROR: %@", error); NSLog(@"ERROR: %@", error);
[MBProgressHUD hideHUD];
[MobClick event:@"reward_display" label:@"reward_display_failed"]; [MobClick event:@"reward_display" label:@"reward_display_failed"];
if (self.GDTTimer) { if (self.GDTTimer) {
dispatch_source_cancel(self.GDTTimer); dispatch_source_cancel(self.GDTTimer);
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
#import "GDTNativeExpressProAdView.h" #import "GDTNativeExpressProAdView.h"
#import "GDTRewardVideoAd.h" #import "GDTRewardVideoAd.h"
#import "GDTSDKConfig.h" #import "GDTSDKConfig.h"
#import "GDTUnifiedNativeAd.h"
#import "GDTNativeExpressAd.h"
#import "GDTNativeExpressAdView.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
...@@ -26,7 +28,7 @@ typedef enum : NSUInteger { ...@@ -26,7 +28,7 @@ typedef enum : NSUInteger {
typedef void (^adsCallBack)(BOOL result, UIView * _Nullable flowView); typedef void (^adsCallBack)(BOOL result, UIView * _Nullable flowView);
@interface GYAdsManager : NSObject<BUSplashAdDelegate, GDTSplashAdDelegate, KSAdSplashInteractDelegate, BUNativeExpressAdViewDelegate, KSFeedAdsManagerDelegate, KSFeedAdDelegate, GDTNativeExpressProAdManagerDelegate, GDTNativeExpressProAdViewDelegate, BUNativeExpressRewardedVideoAdDelegate, KSRewardedVideoAdDelegate, GDTRewardedVideoAdDelegate, BURewardedVideoAdDelegate> @interface GYAdsManager : NSObject<BUSplashAdDelegate, GDTSplashAdDelegate, KSAdSplashInteractDelegate, BUNativeExpressAdViewDelegate, KSFeedAdsManagerDelegate, KSFeedAdDelegate, GDTNativeExpressProAdManagerDelegate, GDTNativeExpressProAdViewDelegate, BUNativeExpressRewardedVideoAdDelegate, KSRewardedVideoAdDelegate, GDTRewardedVideoAdDelegate, BURewardedVideoAdDelegate, GDTNativeExpressAdDelegete>
+ (instancetype)shared; + (instancetype)shared;
...@@ -45,13 +47,10 @@ typedef void (^adsCallBack)(BOOL result, UIView * _Nullable flowView); ...@@ -45,13 +47,10 @@ typedef void (^adsCallBack)(BOOL result, UIView * _Nullable flowView);
@property (nonatomic, strong) BUSplashAdView *splashAd_CSJ; @property (nonatomic, strong) BUSplashAdView *splashAd_CSJ;
@property (nonatomic, strong) BUNativeExpressAdManager * nativeExpressAdManager; @property (nonatomic, strong) BUNativeExpressAdManager * nativeExpressAdManager;
@property (nonatomic, strong) BUNativeExpressRewardedVideoAd * rewardedAd; @property (nonatomic, strong) BUNativeExpressRewardedVideoAd * rewardedAd;
@property (nonatomic, strong) BURewardedVideoAd * rewardedAd_CSJ;
//广点通 //广点通
@property (nonatomic, strong) GDTSplashAd *splashAd_GDT; @property (nonatomic, strong) GDTSplashAd *splashAd_GDT;
@property (nonatomic, strong) GDTNativeExpressProAdManager *adManager;
@property (nonatomic, strong) GDTRewardVideoAd *rewardVideoAd; @property (nonatomic, strong) GDTRewardVideoAd *rewardVideoAd;
@property (nonatomic, strong) GDTNativeExpressAd *nativeExpressAd;
//快手 //快手
@property (nonatomic, strong) KSFeedAdsManager *feedAdsManager; @property (nonatomic, strong) KSFeedAdsManager *feedAdsManager;
@property (nonatomic, strong) KSRewardedVideoAd *rewardedVideoAd; @property (nonatomic, strong) KSRewardedVideoAd *rewardedVideoAd;
...@@ -68,7 +67,7 @@ typedef void (^adsCallBack)(BOOL result, UIView * _Nullable flowView); ...@@ -68,7 +67,7 @@ typedef void (^adsCallBack)(BOOL result, UIView * _Nullable flowView);
@property (nonatomic, strong) dispatch_source_t GDTTimer; @property (nonatomic, strong) dispatch_source_t GDTTimer;
@property (nonatomic, strong) dispatch_source_t CSJTimer; @property (nonatomic, strong) dispatch_source_t CSJTimer;
@property (nonatomic, copy) NSString *clk_tracking; @property (nonatomic, copy) NSString * clk_tracking;
@end @end
......
...@@ -103,8 +103,10 @@ ...@@ -103,8 +103,10 @@
} }
- (void)goSetting{ - (void)goSetting{
if(![self.navigationController.viewControllers.lastObject isMemberOfClass:[GYSettingViewController class]]){
GYSettingViewController * setting = [[UIStoryboard storyboardWithName:@"GYNative" bundle:nil] instantiateViewControllerWithIdentifier:@"GYSettingViewController"]; GYSettingViewController * setting = [[UIStoryboard storyboardWithName:@"GYNative" bundle:nil] instantiateViewControllerWithIdentifier:@"GYSettingViewController"];
[self.navigationController pushViewController:setting animated:YES]; [self.navigationController pushViewController:setting animated:YES];
}
} }
- (void)WXLogin{ - (void)WXLogin{
...@@ -132,7 +134,9 @@ ...@@ -132,7 +134,9 @@
req.state = WXLoginState; req.state = WXLoginState;
//第三方向微信终端发送一个SendAuthReq消息结构 //第三方向微信终端发送一个SendAuthReq消息结构
[WXApi sendAuthReq:req viewController:self.view.window.rootViewController delegate:self completion:^(BOOL success) { [WXApi sendAuthReq:req viewController:self.view.window.rootViewController delegate:self completion:^(BOOL success) {
if (!success){
[MobClick event:@"login_fail" label:@""]; [MobClick event:@"login_fail" label:@""];
}
}]; }];
} }
} }
...@@ -396,7 +400,7 @@ ...@@ -396,7 +400,7 @@
NSDictionary * dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil]; NSDictionary * dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
[self webNativePost:dict]; [self webNativePost:dict];
}else if([message.name isEqualToString:@"h5Jump"]){ }else if([message.name isEqualToString:@"h5Jump"]){
_requestW = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:_url]]; _requestW = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:message.body]];
[self.webView loadRequest:_requestW]; [self.webView loadRequest:_requestW];
} }
} }
......
...@@ -184,8 +184,8 @@ ...@@ -184,8 +184,8 @@
self.startBtn.userInteractionEnabled = false; self.startBtn.userInteractionEnabled = false;
[self.startBtn setBackgroundImage:[UIImage imageNamed:@"wheel_btn_time"] forState:(UIControlStateNormal)]; [self.startBtn setBackgroundImage:[UIImage imageNamed:@"wheel_btn_time"] forState:(UIControlStateNormal)];
} }
[self startBtn:self.startBtn];
} }
}]; }];
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <array/>
<key>SchemeUserState</key>
<dict>
<key>Unity-iPhone.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>10</integer>
</dict>
<key>UnityFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>11</integer>
</dict>
</dict>
</dict>
</plist> </plist>
...@@ -16010,6 +16010,8 @@ IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void iOSNativeApi_getCoin_m79D2AC9B1A0C15902E ...@@ -16010,6 +16010,8 @@ IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void iOSNativeApi_getCoin_m79D2AC9B1A0C15902E
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void UnityToAndroid_stopflyBox_mB0F47FE3A396EB54D30303C922D8C62C378419F3 (UnityToAndroid_tDDAAB44F3451FACAAA69C70CD68E12D24C593707 * __this, const RuntimeMethod* method); IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void UnityToAndroid_stopflyBox_mB0F47FE3A396EB54D30303C922D8C62C378419F3 (UnityToAndroid_tDDAAB44F3451FACAAA69C70CD68E12D24C593707 * __this, const RuntimeMethod* method);
// System.Void DialogControl::showGetBox() // System.Void DialogControl::showGetBox()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void DialogControl_showGetBox_mF739EAAEE4DA13CB8333584E08123916B2ECDDAA (DialogControl_tA9B76C55271F2406028B298858117E195B535A7B * __this, const RuntimeMethod* method); IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void DialogControl_showGetBox_mF739EAAEE4DA13CB8333584E08123916B2ECDDAA (DialogControl_tA9B76C55271F2406028B298858117E195B535A7B * __this, const RuntimeMethod* method);
// System.Void iOSNativeApi::openFlyBox()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void iOSNativeApi_openFlyBox_mBA24B3005768F8D3587221E6D49376CEAB602D3A (const RuntimeMethod* method);
// System.Void DialogControl::closeGetBox() // System.Void DialogControl::closeGetBox()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void DialogControl_closeGetBox_mA738CC2504861F46CBA350BD01CB1380FA83C2F2 (DialogControl_tA9B76C55271F2406028B298858117E195B535A7B * __this, const RuntimeMethod* method); IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void DialogControl_closeGetBox_mA738CC2504861F46CBA350BD01CB1380FA83C2F2 (DialogControl_tA9B76C55271F2406028B298858117E195B535A7B * __this, const RuntimeMethod* method);
// System.Void iOSNativeApi::adFlyBox() // System.Void iOSNativeApi::adFlyBox()
...@@ -32589,6 +32591,8 @@ IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void UnityToAndroid_openFlyBox_m1FBF4C90425B3 ...@@ -32589,6 +32591,8 @@ IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void UnityToAndroid_openFlyBox_m1FBF4C90425B3
DialogControl_tA9B76C55271F2406028B298858117E195B535A7B * L_3 = GameObject_GetComponent_TisDialogControl_tA9B76C55271F2406028B298858117E195B535A7B_m30FC294E8761997E5B396B72B4D0DA7F3DF750F4(L_2, /*hidden argument*/GameObject_GetComponent_TisDialogControl_tA9B76C55271F2406028B298858117E195B535A7B_m30FC294E8761997E5B396B72B4D0DA7F3DF750F4_RuntimeMethod_var); DialogControl_tA9B76C55271F2406028B298858117E195B535A7B * L_3 = GameObject_GetComponent_TisDialogControl_tA9B76C55271F2406028B298858117E195B535A7B_m30FC294E8761997E5B396B72B4D0DA7F3DF750F4(L_2, /*hidden argument*/GameObject_GetComponent_TisDialogControl_tA9B76C55271F2406028B298858117E195B535A7B_m30FC294E8761997E5B396B72B4D0DA7F3DF750F4_RuntimeMethod_var);
NullCheck(L_3); NullCheck(L_3);
DialogControl_showGetBox_mF739EAAEE4DA13CB8333584E08123916B2ECDDAA(L_3, /*hidden argument*/NULL); DialogControl_showGetBox_mF739EAAEE4DA13CB8333584E08123916B2ECDDAA(L_3, /*hidden argument*/NULL);
// iOSNativeApi.openFlyBox();
iOSNativeApi_openFlyBox_mBA24B3005768F8D3587221E6D49376CEAB602D3A(/*hidden argument*/NULL);
// } // }
return; return;
} }
This diff is collapsed.
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<key>Unity-iPhone.xcscheme_^#shared#^_</key> <key>Unity-iPhone.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>9</integer> <integer>10</integer>
</dict> </dict>
<key>UnityFramework.xcscheme_^#shared#^_</key> <key>UnityFramework.xcscheme_^#shared#^_</key>
<dict> <dict>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment