BUNativeExpressBannerView.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. //
  2. // BUNativeExpressBannerView.h
  3. // BUAdSDK
  4. //
  5. // Created by xxx on 2019/5/17.
  6. // Copyright © 2019 bytedance. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "BUMaterialMeta.h"
  10. #import "BUMopubAdMarkUpDelegate.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. @class BUNativeExpressBannerView;
  13. @class BUDislikeWords;
  14. @class BUSize;
  15. @protocol BUNativeExpressBannerViewDelegate <NSObject>
  16. @optional
  17. /**
  18. This method is called when bannerAdView ad slot loaded successfully.
  19. @param bannerAdView : view for bannerAdView
  20. */
  21. - (void)nativeExpressBannerAdViewDidLoad:(BUNativeExpressBannerView *)bannerAdView;
  22. /**
  23. This method is called when bannerAdView ad slot failed to load.
  24. @param error : the reason of error
  25. */
  26. - (void)nativeExpressBannerAdView:(BUNativeExpressBannerView *)bannerAdView didLoadFailWithError:(NSError *_Nullable)error;
  27. /**
  28. This method is called when rendering a nativeExpressAdView successed.
  29. */
  30. - (void)nativeExpressBannerAdViewRenderSuccess:(BUNativeExpressBannerView *)bannerAdView;
  31. /**
  32. This method is called when a nativeExpressAdView failed to render.
  33. @param error : the reason of error
  34. */
  35. - (void)nativeExpressBannerAdViewRenderFail:(BUNativeExpressBannerView *)bannerAdView error:(NSError * __nullable)error;
  36. /**
  37. This method is called when bannerAdView ad slot showed new ad.
  38. */
  39. - (void)nativeExpressBannerAdViewWillBecomVisible:(BUNativeExpressBannerView *)bannerAdView;
  40. /**
  41. This method is called when bannerAdView is clicked.
  42. */
  43. - (void)nativeExpressBannerAdViewDidClick:(BUNativeExpressBannerView *)bannerAdView;
  44. /**
  45. This method is called when the user clicked dislike button and chose dislike reasons.
  46. @param filterwords : the array of reasons for dislike.
  47. */
  48. - (void)nativeExpressBannerAdView:(BUNativeExpressBannerView *)bannerAdView dislikeWithReason:(NSArray<BUDislikeWords *> *_Nullable)filterwords;
  49. /**
  50. This method is called when another controller has been closed.
  51. @param interactionType : open appstore in app or open the webpage or view video ad details page.
  52. */
  53. - (void)nativeExpressBannerAdViewDidCloseOtherController:(BUNativeExpressBannerView *)bannerAdView interactionType:(BUInteractionType)interactionType;
  54. /**
  55. This method is called when the Ad view container is forced to be removed.
  56. @param bannerAdView : Express Banner Ad view container
  57. */
  58. - (void)nativeExpressBannerAdViewDidRemoved:(BUNativeExpressBannerView *)bannerAdView;
  59. @end
  60. @interface BUNativeExpressBannerView : UIView <BUMopubAdMarkUpDelegate>
  61. @property (nonatomic, weak, nullable) id<BUNativeExpressBannerViewDelegate> delegate;
  62. /**
  63. The carousel interval, in seconds, is set in the range of 30~120s, and is passed during initialization. If it does not meet the requirements, it will not be in carousel ad.
  64. */
  65. @property (nonatomic, assign, readonly) NSInteger interval;
  66. /// media configuration parameters.
  67. @property (nonatomic, copy, readonly) NSDictionary *mediaExt;
  68. /**
  69. Initializes express banner ad.
  70. @param slotID The unique identifier of banner ad.
  71. @param rootViewController The root controller where the banner is located.
  72. @param adsize Customize the size of the view. Please make sure that the width and height passed in are available.
  73. @return BUNativeExpressBannerView
  74. */
  75. - (instancetype)initWithSlotID:(NSString *)slotID
  76. rootViewController:(UIViewController *)rootViewController
  77. adSize:(CGSize)adsize;
  78. /**
  79. Initializes carousel express banner ad.
  80. @param slotID The unique identifier of banner ad.
  81. @param rootViewController The root controller where the banner is located.
  82. @param adsize Customize the size of the view. Please make sure that the width and height passed in are available.
  83. @param interval The carousel interval, in seconds, is set in the range of 30~120s, and is passed during initialization. If it does not meet the requirements, it will not be in carousel ad.
  84. @return BUNativeExpressBannerView
  85. */
  86. - (instancetype)initWithSlotID:(NSString *)slotID
  87. rootViewController:(UIViewController *)rootViewController
  88. adSize:(CGSize)adsize
  89. interval:(NSInteger)interval;
  90. /**
  91. Initializes express banner ad.
  92. @param slot A object, through which you can pass in the banner unique identifier, ad type, and so on
  93. @param rootViewController The root controller where the banner is located.
  94. @param adsize Customize the size of the view. Please make sure that the width and height passed in are available.
  95. @return BUNativeExpressBannerView
  96. */
  97. - (instancetype)initWithSlot:(BUAdSlot *)slot
  98. rootViewController:(UIViewController *)rootViewController
  99. adSize:(CGSize)adsize;
  100. /**
  101. Initializes carousel express banner ad.
  102. @param slot A object, through which you can pass in the banner unique identifier, ad type, and so on
  103. @param rootViewController The root controller where the banner is located.
  104. @param adsize Customize the size of the view. Please make sure that the width and height passed in are available.
  105. @param interval The carousel interval, in seconds, is set in the range of 30~120s, and is passed during initialization. If it does not meet the requirements, it will not be in carousel ad.
  106. @return BUNativeExpressBannerView
  107. */
  108. - (instancetype)initWithSlot:(BUAdSlot *)slot
  109. rootViewController:(UIViewController *)rootViewController
  110. adSize:(CGSize)adsize
  111. interval:(NSInteger)interval;
  112. - (void)loadAdData;
  113. @end
  114. @interface BUNativeExpressBannerView (Deprecated)
  115. - (instancetype)initWithSlotID:(NSString *)slotID
  116. rootViewController:(UIViewController *)rootViewController
  117. adSize:(CGSize)adsize
  118. IsSupportDeepLink:(BOOL)isSupportDeepLink DEPRECATED_MSG_ATTRIBUTE("Use initWithSlotID:rootViewController:adSize: instead.");
  119. - (instancetype)initWithSlotID:(NSString *)slotID
  120. rootViewController:(UIViewController *)rootViewController
  121. adSize:(CGSize)adsize
  122. IsSupportDeepLink:(BOOL)isSupportDeepLink
  123. interval:(NSInteger)interval DEPRECATED_MSG_ATTRIBUTE("Use initWithSlotID:rootViewController:adSize:interval: instead.");
  124. @end
  125. NS_ASSUME_NONNULL_END