GDTNativeExpressAd.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. //
  2. // GDTNativeExpressAd.h
  3. // GDTMobApp
  4. //
  5. // Created by michaelxing on 2017/4/17.
  6. // Copyright © 2017年 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. #import "GDTSDKDefines.h"
  11. @class GDTNativeExpressAdView;
  12. @class GDTNativeExpressAd;
  13. @protocol GDTNativeExpressAdDelegete <NSObject>
  14. @optional
  15. /**
  16. * 拉取原生模板广告成功
  17. */
  18. - (void)nativeExpressAdSuccessToLoad:(GDTNativeExpressAd *)nativeExpressAd views:(NSArray<__kindof GDTNativeExpressAdView *> *)views;
  19. /**
  20. * 拉取原生模板广告失败
  21. */
  22. - (void)nativeExpressAdFailToLoad:(GDTNativeExpressAd *)nativeExpressAd error:(NSError *)error;
  23. /**
  24. * 原生模板广告渲染成功, 此时的 nativeExpressAdView.size.height 根据 size.width 完成了动态更新。
  25. */
  26. - (void)nativeExpressAdViewRenderSuccess:(GDTNativeExpressAdView *)nativeExpressAdView;
  27. /**
  28. * 原生模板广告渲染失败
  29. */
  30. - (void)nativeExpressAdViewRenderFail:(GDTNativeExpressAdView *)nativeExpressAdView;
  31. /**
  32. * 原生模板广告曝光回调
  33. */
  34. - (void)nativeExpressAdViewExposure:(GDTNativeExpressAdView *)nativeExpressAdView;
  35. /**
  36. * 原生模板广告点击回调
  37. */
  38. - (void)nativeExpressAdViewClicked:(GDTNativeExpressAdView *)nativeExpressAdView;
  39. /**
  40. * 原生模板广告被关闭
  41. */
  42. - (void)nativeExpressAdViewClosed:(GDTNativeExpressAdView *)nativeExpressAdView;
  43. /**
  44. * 点击原生模板广告以后即将弹出全屏广告页
  45. */
  46. - (void)nativeExpressAdViewWillPresentScreen:(GDTNativeExpressAdView *)nativeExpressAdView;
  47. /**
  48. * 点击原生模板广告以后弹出全屏广告页
  49. */
  50. - (void)nativeExpressAdViewDidPresentScreen:(GDTNativeExpressAdView *)nativeExpressAdView;
  51. /**
  52. * 全屏广告页将要关闭
  53. */
  54. - (void)nativeExpressAdViewWillDismissScreen:(GDTNativeExpressAdView *)nativeExpressAdView;
  55. /**
  56. * 全屏广告页将要关闭
  57. */
  58. - (void)nativeExpressAdViewDidDismissScreen:(GDTNativeExpressAdView *)nativeExpressAdView;
  59. /**
  60. * 详解:当点击应用下载或者广告调用系统程序打开时调用
  61. */
  62. - (void)nativeExpressAdViewApplicationWillEnterBackground:(GDTNativeExpressAdView *)nativeExpressAdView;
  63. /**
  64. * 原生模板视频广告 player 播放状态更新回调
  65. */
  66. - (void)nativeExpressAdView:(GDTNativeExpressAdView *)nativeExpressAdView playerStatusChanged:(GDTMediaPlayerStatus)status;
  67. /**
  68. * 原生视频模板详情页 WillPresent 回调
  69. */
  70. - (void)nativeExpressAdViewWillPresentVideoVC:(GDTNativeExpressAdView *)nativeExpressAdView;
  71. /**
  72. * 原生视频模板详情页 DidPresent 回调
  73. */
  74. - (void)nativeExpressAdViewDidPresentVideoVC:(GDTNativeExpressAdView *)nativeExpressAdView;
  75. /**
  76. * 原生视频模板详情页 WillDismiss 回调
  77. */
  78. - (void)nativeExpressAdViewWillDismissVideoVC:(GDTNativeExpressAdView *)nativeExpressAdView;
  79. /**
  80. * 原生视频模板详情页 DidDismiss 回调
  81. */
  82. - (void)nativeExpressAdViewDidDismissVideoVC:(GDTNativeExpressAdView *)nativeExpressAdView;
  83. @end
  84. @interface GDTNativeExpressAd : NSObject
  85. /**
  86. * 委托对象
  87. */
  88. @property (nonatomic, weak) id<GDTNativeExpressAdDelegete> delegate;
  89. /**
  90. * 非 WiFi 网络,是否自动播放。默认 NO。loadAd 前设置。
  91. */
  92. @property (nonatomic, assign) BOOL videoAutoPlayOnWWAN;
  93. /**
  94. * 自动播放时,是否静音。默认 YES。loadAd 前设置。
  95. */
  96. @property (nonatomic, assign) BOOL videoMuted;
  97. /**
  98. * 视频详情页播放时是否静音。默认NO。loadAd 前设置。
  99. */
  100. @property (nonatomic, assign) BOOL detailPageVideoMuted;
  101. /**
  102. 请求视频的时长下限。
  103. 以下两种情况会使用 0,1:不设置 2:minVideoDuration大于maxVideoDuration
  104. */
  105. @property (nonatomic) NSInteger minVideoDuration;
  106. /**
  107. 请求视频的时长上限,视频时长有效值范围为[5,180]。
  108. */
  109. @property (nonatomic) NSInteger maxVideoDuration;
  110. @property (nonatomic, readonly) NSString *placementId;
  111. /**
  112. * 构造方法
  113. * 详解:placementId - 广告位 ID
  114. * adSize - 广告展示的宽高
  115. */
  116. - (instancetype)initWithPlacementId:(NSString *)placementId adSize:(CGSize)size;
  117. /**
  118. * 构造方法
  119. * 详解:appId - 媒体 ID
  120. * placementId - 广告位 ID
  121. * adSize - 广告展示的宽高
  122. */
  123. - (instancetype)initWithAppId:(NSString *)appId placementId:(NSString *)placementId adSize:(CGSize)size GDT_DEPRECATED_MSG_ATTRIBUTE("接口即将废弃,请使用 initWithPlacementId:adSize:");
  124. - (void)loadAd:(NSInteger)count;
  125. /**
  126. 返回广告平台名称
  127. @return 当使用流量分配功能时,用于区分广告平台;未使用时为空字符串
  128. */
  129. - (NSString *)adNetworkName;
  130. @end