zoukankan      html  css  js  c++  java
  • iOS添加广告的主要方法

      1. //用户取消正在执行的广告时 调用  
      2. - (void)cancelBannerViewAction {  
      3.     NSLog(@"Banner was cancelled!");  
      4.       
      5.     self.adStatus.text = @"[iAd]: Bannes was closed.";  
      6. }  
      7.   
      8. //苹果公司给你发送一个广告 ! 通过此方法,广告视图ADBannerView 开始显示  
      9. //此方法,每间隔一段时间(46秒) 刷新一次  
      10. - (void)bannerViewDidLoadAd:(ADBannerView *)banner {  
      11.     NSLog(@"[iAd]: Ad did load.");  
      12.     self.adStatus.text = @"[iAd]: Ad did load.";  
      13. }  
      14.   
      15. //someone 点击了 广告  
      16. - (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave {  
      17.     NSLog(@"[iAd]: An action was started from the banner. Application will quit: %d", willLeave);  
      18.       
      19.     self.adStatus.text =[NSString stringWithFormat: @"[iAd]: An action was started from the banner. Application will quit: %d", willLeave];  
      20.       
      21.     return YES;  
      22. }  
      23. //广告执行完成,返回  
      24. - (void)bannerViewActionDidFinish:(ADBannerView *)banner {  
      25.     NSLog(@"[iAd]: Action finished.");  
      26.       
      27.     self.adStatus.text = @"[iAd]: Action finished.";  
      28. }  
      29. //加载广告错误,或者没有广告时,调用此方法,因为广告有时候会显示,有时候不会  
      30. - (void)bannerView:(ADBannerView *) didFailToReceiveAdWithError:(NSError *)error {  
      31.     NSLog(@"[iAd]: Faild to load the banner: %@", error);  
      32.       
      33.     self.adStatus.text = [NSString stringWithFormat:@"[iAd]: Faild to load the banner: %@", error];  
      34. }
  • 相关阅读:
    百度mp3地址解密码
    VB 在EXE后附加信息
    截屏函数
    Base64和StrToByte
    The Android ION memory allocator, DMABUF is mentioned as well
    DDC EDID 介绍
    Memory management for graphic processors TTM的由来
    科普 写display driver的必看 How video card works [2D的四种主要操作]
    GEM vs TTM
    DMABUF 背景介绍文章 Sharing buffers between devices
  • 原文地址:https://www.cnblogs.com/zhangyang17/p/3587476.html
Copyright © 2011-2022 走看看