| | |
| | | #import "ListController.h" |
| | | #import <BUAdSDK/BUAdSDK.h> |
| | | #import "DYGridVideoController.h" |
| | | #import "UIView+Toast.h" |
| | | |
| | | @interface RecommendMainController () <ZJScrollPageViewDelegate,BUNativeExpressFullscreenVideoAdDelegate> |
| | | |
| | |
| | | |
| | | [[YTHNetInterface startInterface] getVideoClassWithUid:[YTHsharedManger startManger].Uid WithSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) { |
| | | if (isSuccessful) { |
| | | |
| | | [self.arrayClassName removeAllObjects]; |
| | | [self.arrayKeyName removeAllObjects]; |
| | | for (int i = 0; i < [result[@"Data"][@"data"] count]; i++) { |
| | | [self.arrayClassName addObject:result[@"Data"][@"data"][i][@"Name"]]; |
| | | [self.arrayKeyName addObject:result[@"Data"][@"data"][i]]; |
| | |
| | | - (void)loadFullscreenVideoAd { |
| | | id interstitial=[YTHsharedManger startManger].ad[@"homeInterstitial"]; |
| | | if(interstitial==nil|| interstitial==[NSNull null] ||interstitial[@"type"]==nil){ |
| | | //[self.view makeToast:@"首页插屏广告被屏蔽"]; |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ |
| | | |
| | | //[self.view makeToast:@"开始加载插屏广告"]; |
| | | NSLog(@"广告开始加载-首页插屏"); |
| | | self.fullscreenAd = [[BUNativeExpressFullscreenVideoAd alloc] initWithSlotID:@"947698171"]; |
| | | self.fullscreenAd.delegate = self; |
| | |
| | | |
| | | //此方法在视频广告素材加载成功时调用。 |
| | | - (void)nativeExpressFullscreenVideoAdDidLoad:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd { |
| | | |
| | | // [self.view makeToast:@"插屏广告加载成功"]; |
| | | } |
| | | |
| | | //当视频广告素材加载失败时调用此方法。 |
| | | - (void)nativeExpressFullscreenVideoAd:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error { |
| | | NSLog(@"nativeExpressFullscreenVideoAd"); |
| | | //[self.view makeToast:@"插屏广告加载失败"]; |
| | | } |
| | | |
| | | //此方法在成功呈现nativeExpressAdView时调用。 |
| | |
| | | //当nativeExpressAdView无法呈现时,将调用此方法 |
| | | - (void)nativeExpressFullscreenVideoAdViewRenderFail:(BUNativeExpressFullscreenVideoAd *)rewardedVideoAd error:(NSError *_Nullable)error { |
| | | NSLog(@"nativeExpressFullscreenVideoAdViewRenderFail"); |
| | | //[self.view makeToast:@"无法呈现插屏广告"]; |
| | | } |
| | | //当视频缓存成功时调用此方法 |
| | | - (void)nativeExpressFullscreenVideoAdDidDownLoadVideo:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd { |