GDTUnifiedBannerView.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. //
  2. // GDTUnifiedBannerView.h
  3. // GDTMobSDK
  4. //
  5. // Created by nimomeng on 2019/3/1.
  6. // Copyright © 2019 Tencent. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "GDTLoadAdParams.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. @class GDTUnifiedBannerView;
  12. @protocol GDTUnifiedBannerViewDelegate <NSObject>
  13. @optional
  14. /**
  15. * 请求广告条数据成功后调用
  16. * 当接收服务器返回的广告数据成功后调用该函数
  17. */
  18. - (void)unifiedBannerViewDidLoad:(GDTUnifiedBannerView *)unifiedBannerView;
  19. /**
  20. * 请求广告条数据失败后调用
  21. * 当接收服务器返回的广告数据失败后调用该函数
  22. */
  23. - (void)unifiedBannerViewFailedToLoad:(GDTUnifiedBannerView *)unifiedBannerView error:(NSError *)error;
  24. /**
  25. * banner2.0曝光回调
  26. */
  27. - (void)unifiedBannerViewWillExpose:(GDTUnifiedBannerView *)unifiedBannerView;
  28. /**
  29. * banner2.0点击回调
  30. */
  31. - (void)unifiedBannerViewClicked:(GDTUnifiedBannerView *)unifiedBannerView;
  32. /**
  33. * banner2.0广告点击以后即将弹出全屏广告页
  34. */
  35. - (void)unifiedBannerViewWillPresentFullScreenModal:(GDTUnifiedBannerView *)unifiedBannerView;
  36. /**
  37. * banner2.0广告点击以后弹出全屏广告页完毕
  38. */
  39. - (void)unifiedBannerViewDidPresentFullScreenModal:(GDTUnifiedBannerView *)unifiedBannerView;
  40. /**
  41. * 全屏广告页即将被关闭
  42. */
  43. - (void)unifiedBannerViewWillDismissFullScreenModal:(GDTUnifiedBannerView *)unifiedBannerView;
  44. /**
  45. * 全屏广告页已经被关闭
  46. */
  47. - (void)unifiedBannerViewDidDismissFullScreenModal:(GDTUnifiedBannerView *)unifiedBannerView;
  48. /**
  49. * 当点击应用下载或者广告调用系统程序打开
  50. */
  51. - (void)unifiedBannerViewWillLeaveApplication:(GDTUnifiedBannerView *)unifiedBannerView;
  52. /**
  53. * banner2.0被用户关闭时调用
  54. */
  55. - (void)unifiedBannerViewWillClose:(GDTUnifiedBannerView *)unifiedBannerView;
  56. @end
  57. @interface GDTUnifiedBannerView : UIView
  58. /**
  59. * 委托 [可选]
  60. */
  61. @property (nonatomic, weak) id<GDTUnifiedBannerViewDelegate> delegate;
  62. /**
  63. * Banner展现和轮播时的动画效果开关,默认打开
  64. */
  65. @property (nonatomic) BOOL animated;
  66. /**
  67. * 广告刷新间隔,范围 [30, 120] 秒,默认值 30 秒。设 0 则不刷新。 [可选]
  68. */
  69. @property (nonatomic) int autoSwitchInterval;
  70. /**
  71. * QQ小游戏SDK字段透传
  72. */
  73. @property (nonatomic, strong) GDTLoadAdParams *loadAdParams;
  74. /**
  75. * 构造方法
  76. * 详解:placementId - 广告位 ID
  77. * viewController - 视图控制器
  78. */
  79. - (instancetype)initWithPlacementId:(NSString *)placementId
  80. viewController:(UIViewController *)viewController;
  81. /**
  82. * 构造方法
  83. * 详解:frame - banner 展示的位置和大小
  84. * placementId - 广告位 ID
  85. * viewController - 视图控制器
  86. */
  87. - (instancetype)initWithFrame:(CGRect)frame
  88. placementId:(NSString *)placementId
  89. viewController:(UIViewController *)viewController;
  90. /**
  91. * 拉取并展示广告
  92. */
  93. - (void)loadAdAndShow;
  94. @end
  95. NS_ASSUME_NONNULL_END