GDTNativeExpressProAdView.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. //
  2. // GDTNativeExpressProAdView.h
  3. // GDTMobApp
  4. //
  5. // Created by royqpwang on 2020/4/28.
  6. // Copyright © 2020 Tencent. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "GDTAdParams.h"
  10. #import "GDTSDKDefines.h"
  11. #import "GDTAdProtocol.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. @class GDTNativeExpressProAdView;
  14. @protocol GDTNativeExpressProAdViewDelegate <NSObject>
  15. @optional
  16. /**
  17. * 原生模板2.0广告渲染成功, 此时的 nativeExpressAdView.size.height 根据 size.width 完成了动态更新。
  18. */
  19. - (void)gdt_NativeExpressProAdViewRenderSuccess:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  20. /**
  21. * 原生模板2.0广告渲染失败
  22. */
  23. - (void)gdt_NativeExpressProAdViewRenderFail:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  24. /**
  25. * 原生模板2.0广告曝光回调
  26. */
  27. - (void)gdt_NativeExpressProAdViewExposure:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  28. /**
  29. * 原生模板2.0广告点击回调
  30. */
  31. - (void)gdt_NativeExpressProAdViewClicked:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  32. /**
  33. * 原生模板2.0广告被关闭
  34. */
  35. - (void)gdt_NativeExpressProAdViewClosed:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  36. /**
  37. * 点击原生模板2.0广告以后即将弹出全屏广告页
  38. */
  39. - (void)gdt_NativeExpressProAdViewWillPresentScreen:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  40. /**
  41. * 点击原生模板2.0广告以后弹出全屏广告页
  42. */
  43. - (void)gdt_NativeExpressProAdViewDidPresentScreen:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  44. /**
  45. * 全屏广告页将要关闭
  46. */
  47. - (void)gdt_NativeExpressProAdViewWillDissmissScreen:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  48. /**
  49. * 全屏广告页已经关闭
  50. */
  51. - (void)gdt_NativeExpressProAdViewDidDissmissScreen:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  52. /**
  53. * 视频详情页 WillPresent 回调
  54. */
  55. - (void)gdt_NativeExpressProAdViewWillPresentVideoVC:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  56. /**
  57. * 视频详情页 DidPresent 回调
  58. */
  59. - (void)gdt_NativeExpressProAdViewDidPresentVideoVC:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  60. /**
  61. * 视频详情页 WillDismiss 回调
  62. */
  63. - (void)gdt_NativeExpressProAdViewWillDismissVideoVC:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  64. /**
  65. * 视频详情页 DidDismiss 回调
  66. */
  67. - (void)gdt_NativeExpressProAdViewDidDismissVideoVC:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  68. /**
  69. * 详解:当点击应用下载或者广告调用系统程序打开时调用
  70. */
  71. - (void)gdt_NativeExpressProAdViewApplicationWillEnterBackground:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  72. /**
  73. * 原生模板视频广告 player 播放状态更新回调
  74. */
  75. - (void)gdt_NativeExpressProAdView:(GDTNativeExpressProAdView *)nativeExpressProAdView playerStatusChanged:(GDTMediaPlayerStatus)status;
  76. - (void)gdt_NativeExpressProAdViewVideoDidFinished:(GDTNativeExpressProAdView *)nativeExpressProAdView;
  77. @end
  78. @interface GDTNativeExpressProAdView : UIView <GDTAdProtocol>
  79. @property (nonatomic, weak) id <GDTNativeExpressProAdViewDelegate> delegate;
  80. /**
  81. * 是否渲染完毕
  82. */
  83. @property (nonatomic, assign, readonly) BOOL isReady;
  84. /**
  85. * 是否是视频模板广告
  86. */
  87. @property (nonatomic, assign, readonly) BOOL isVideoAd;
  88. /*
  89. * viewControllerForPresentingModalView
  90. * 详解:[必选]开发者需传入用来弹出目标页的ViewController,一般为当前ViewController
  91. */
  92. @property (nonatomic, weak) UIViewController *controller;
  93. /**
  94. *[必选]
  95. *原生模板2.0广告渲染
  96. */
  97. - (void)render;
  98. /**
  99. * 视频模板广告时长,单位 ms
  100. */
  101. - (CGFloat)videoDuration;
  102. /**
  103. * 视频模板广告已播放时长,单位 ms
  104. */
  105. - (CGFloat)videoPlayTime;
  106. /**
  107. 返回广告的eCPM,单位:分
  108. @return 成功返回一个大于等于0的值,-1表示无权限或后台出现异常
  109. */
  110. - (NSInteger)eCPM;
  111. /**
  112. 返回广告的eCPM等级
  113. @return 成功返回一个包含数字的string,@""或nil表示无权限或后台异常
  114. */
  115. - (NSString *)eCPMLevel;
  116. @end
  117. NS_ASSUME_NONNULL_END