GDTNativeExpressProAdView.h 3.3 KB

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