GDTNativeExpressRewardVideoAd.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. //
  2. // GDTNativeExpressRewardVideoAd.h
  3. // GDTMobApp
  4. //
  5. // Created by royqpwang on 2020/7/6.
  6. // Copyright © 2020 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "GDTServerSideVerificationOptions.h"
  10. #import "GDTSDKDefines.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. @protocol GDTNativeExpressRewardedVideoAdDelegate;
  13. @interface GDTNativeExpressRewardVideoAd : NSObject
  14. @property (nonatomic, getter=isAdValid, readonly) BOOL adValid;
  15. @property (nonatomic) BOOL videoMuted;
  16. @property (nonatomic, assign, readonly) NSInteger expiredTimestamp;
  17. @property (nonatomic, weak) id <GDTNativeExpressRewardedVideoAdDelegate> delegate;
  18. @property (nonatomic, readonly) NSString *placementId;
  19. @property (nonatomic, strong) GDTServerSideVerificationOptions *serverSideVerificationOptions;
  20. /**
  21. 构造方法
  22. @param placementId - 广告位 ID
  23. @return GDTRewardVideoAd 实例
  24. */
  25. - (instancetype)initWithPlacementId:(NSString *)placementId;
  26. /**
  27. 加载广告方法 支持 iOS9 及以上系统
  28. */
  29. - (void)loadAd;
  30. /**
  31. 展示广告方法
  32. @param rootViewController 用于 present 激励视频 VC
  33. @return 是否展示成功
  34. */
  35. - (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
  36. /**
  37. 返回广告的eCPM,单位:分
  38. @return 成功返回一个大于等于0的值,-1表示无权限或后台出现异常
  39. */
  40. - (NSInteger)eCPM;
  41. /**
  42. 返回广告的eCPM等级
  43. @return 成功返回一个包含数字的string,@""或nil表示无权限或后台异常
  44. */
  45. - (NSString *)eCPMLevel;
  46. /**
  47. 返回广告平台名称
  48. @return 当使用激励视频聚合功能时,用于区分广告平台
  49. */
  50. - (NSString *)adNetworkName;
  51. /**
  52. * 激励视频广告时长,单位 ms
  53. */
  54. - (CGFloat)videoDuration;
  55. @end
  56. @protocol GDTNativeExpressRewardedVideoAdDelegate <NSObject>
  57. @optional
  58. /**
  59. 广告数据加载成功回调
  60. @param rewardedVideoAd GDTRewardVideoAd 实例
  61. */
  62. - (void)gdt_nativeExpressRewardVideoAdDidLoad:(GDTNativeExpressRewardVideoAd *)rewardedVideoAd;
  63. /**
  64. 视频数据下载成功回调,已经下载过的视频会直接回调
  65. @param rewardedVideoAd GDTRewardVideoAd 实例
  66. */
  67. - (void)gdt_nativeExpressRewardVideoAdVideoDidLoad:(GDTNativeExpressRewardVideoAd *)rewardedVideoAd;
  68. /**
  69. 视频播放页即将展示回调
  70. @param rewardedVideoAd GDTRewardVideoAd 实例
  71. */
  72. - (void)gdt_nativeExpressRewardVideoAdWillVisible:(GDTNativeExpressRewardVideoAd *)rewardedVideoAd;
  73. /**
  74. 视频广告曝光回调
  75. @param rewardedVideoAd GDTRewardVideoAd 实例
  76. */
  77. - (void)gdt_nativeExpressRewardVideoAdDidExposed:(GDTNativeExpressRewardVideoAd *)rewardedVideoAd;
  78. /**
  79. 视频播放页关闭回调
  80. @param rewardedVideoAd GDTRewardVideoAd 实例
  81. */
  82. - (void)gdt_nativeExpressRewardVideoAdDidClose:(GDTNativeExpressRewardVideoAd *)rewardedVideoAd;
  83. /**
  84. 视频广告信息点击回调
  85. @param rewardedVideoAd GDTRewardVideoAd 实例
  86. */
  87. - (void)gdt_nativeExpressRewardVideoAdDidClicked:(GDTNativeExpressRewardVideoAd *)rewardedVideoAd;
  88. /**
  89. 视频广告各种错误信息回调
  90. @param rewardedVideoAd GDTRewardVideoAd 实例
  91. @param error 具体错误信息
  92. */
  93. - (void)gdt_nativeExpressRewardVideoAd:(GDTNativeExpressRewardVideoAd *)rewardedVideoAd didFailWithError:(NSError *)error;
  94. /**
  95. 视频广告播放达到激励条件回调
  96. @param rewardedVideoAd GDTRewardVideoAd 实例
  97. */
  98. - (void)gdt_nativeExpressRewardVideoAdDidRewardEffective:(GDTNativeExpressRewardVideoAd *)rewardedVideoAd GDT_DEPRECATED_MSG_ATTRIBUTE("接口即将废弃,请使用 gdt_nativeExpressRewardVideoAdDidRewardEffective:info:");;
  99. /**
  100. 视频广告播放达到激励条件回调
  101. @param rewardedVideoAd GDTRewardVideoAd 实例
  102. */
  103. - (void)gdt_nativeExpressRewardVideoAdDidRewardEffective:(GDTNativeExpressRewardVideoAd *)rewardedVideoAd info:(NSDictionary *)info;
  104. /**
  105. 视频广告视频播放完成
  106. @param rewardedVideoAd GDTRewardVideoAd 实例
  107. */
  108. - (void)gdt_nativeExpressRewardVideoAdDidPlayFinish:(GDTNativeExpressRewardVideoAd *)rewardedVideoAd;
  109. @end
  110. NS_ASSUME_NONNULL_END