GDTUnifiedNativeAdDataObject.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. //
  2. // GDTUnifiedNativeAdDataObject.h
  3. // GDTMobSDK
  4. //
  5. // Created by nimomeng on 2018/10/10.
  6. // Copyright © 2018 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. #import "GDTVideoConfig.h"
  11. #import "GDTSDKDefines.h"
  12. typedef NS_ENUM(NSInteger, GDTVastAdEventType) {
  13. GDTVastAdEventTypeUnknow,
  14. GDTVastAdEventTypeLoaded,
  15. GDTVastAdEventTypeStarted,
  16. GDTVastAdEventTypeFirstQuartile,
  17. GDTVastAdEventTypeMidPoint,
  18. GDTVastAdEventTypeThirdQuartile,
  19. GDTVastAdEventTypeComplete,
  20. GDTVastAdEventTypeAllAdsComplete,
  21. GDTVastAdEventTypeExposed,
  22. GDTVastAdEventTypeClicked,
  23. };
  24. @interface GDTUnifiedNativeAdDataObject : NSObject
  25. /**
  26. 广告标题
  27. */
  28. @property (nonatomic, copy, readonly) NSString *title;
  29. /**
  30. 广告描述
  31. */
  32. @property (nonatomic, copy, readonly) NSString *desc;
  33. /**
  34. 素材宽度,单图广告代表大图 imageUrl 宽度、多图广告代表小图 mediaUrlList 宽度
  35. */
  36. @property (nonatomic, readonly) NSInteger imageWidth;
  37. /**
  38. 素材高度,单图广告代表大图 imageUrl 高度、多图广告代表小图 mediaUrlList 高度
  39. */
  40. @property (nonatomic, readonly) NSInteger imageHeight;
  41. /**
  42. 应用类广告App 图标Url
  43. */
  44. @property (nonatomic, copy, readonly) NSString *iconUrl;
  45. /**
  46. 应用类广告的星级(5星制度)
  47. */
  48. @property (nonatomic, readonly) CGFloat appRating;
  49. /**
  50. 应用类广告的价格
  51. */
  52. @property (nonatomic, strong, readonly) NSNumber *appPrice;
  53. /**
  54. 是否为应用类广告
  55. */
  56. @property (nonatomic, readonly) BOOL isAppAd;
  57. /**
  58. 是否为视频广告
  59. */
  60. @property (nonatomic, readonly) BOOL isVideoAd;
  61. /**
  62. 是否为三小图广告
  63. */
  64. @property (nonatomic, readonly) BOOL isThreeImgsAd;
  65. /**
  66. 返回广告的eCPM,单位:分
  67. @return 成功返回一个大于等于0的值,-1表示无权限或后台出现异常
  68. */
  69. @property (nonatomic, readonly) NSInteger eCPM;
  70. /**
  71. 返回广告的eCPM等级
  72. @return 成功返回一个包含数字的string,@""或nil表示无权限或后台异常
  73. */
  74. @property (nonatomic, readonly) NSString *eCPMLevel;
  75. /**
  76. 广告对应的CTA文案,自定义CTA视图时建议使用此字段
  77. 广告对应的callToAction文案,比如“立即预约”或“电话咨询”, 自定义callToAction视图时建议使用此字段
  78. 该字段在部分广告类型中可能为空
  79. */
  80. @property (nonatomic, readonly) NSString *callToAction;
  81. /**
  82. 返回广告是否可以跳过,用于做前贴片场景
  83. @return YES 表示可跳过、NO 表示不可跳过
  84. */
  85. @property (nonatomic, readonly) BOOL skippable;
  86. /**
  87. 视频广告播放配置
  88. */
  89. @property (nonatomic, strong) GDTVideoConfig *videoConfig;
  90. /**
  91. * 视频广告时长,单位 ms
  92. */
  93. @property (nonatomic, readonly) CGFloat duration;
  94. /**
  95. * VAST Tag Url,可能为空。
  96. */
  97. @property (nonatomic, copy, readonly) NSString *vastTagUrl;
  98. /**
  99. * VAST Content,可能为空。
  100. */
  101. @property (nonatomic, copy, readonly) NSString *vastContent;
  102. /**
  103. * 是否为 VAST 广告
  104. */
  105. @property (nonatomic, assign, readonly) BOOL isVastAd;
  106. /**
  107. 判断两个自渲染2.0广告数据是否相等
  108. @param dataObject 需要对比的自渲染2.0广告数据对象
  109. @return YES or NO
  110. */
  111. - (BOOL)equalsAdData:(GDTUnifiedNativeAdDataObject *)dataObject;
  112. /**
  113. * 绑定展示的图片视图
  114. *
  115. * @param imageViews 进行渲染的 imageView
  116. * @param placeholder 图片加载过程中的占位图
  117. */
  118. - (void)bindImageViews:(NSArray<UIImageView *> *)imageViews placeholder:(UIImage *)placeholder;
  119. /**
  120. 广告大图Url
  121. */
  122. @property (nonatomic, copy, readonly) NSString *imageUrl GDT_DEPRECATED_MSG_ATTRIBUTE("属性即将废弃,请使用 bindImageViews:placeholder: 方法");
  123. /**
  124. 三小图广告的图片Url集合
  125. */
  126. @property (nonatomic, copy, readonly) NSArray *mediaUrlList GDT_DEPRECATED_MSG_ATTRIBUTE("属性即将废弃,请使用 bindImageViews:placeholder: 方法");
  127. @end