BUNativeExpressInterstitialAd.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //
  2. // BUNativeExpressInterstitialAd.h
  3. // BUAdSDK
  4. //
  5. // Created by xxx on 2019/5/16.
  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 BUSize;
  13. @class BUNativeExpressInterstitialAd;
  14. @protocol BUNativeExpresInterstitialAdDelegate <NSObject>
  15. @optional
  16. /**
  17. This method is called when interstitial ad material loaded successfully.
  18. */
  19. - (void)nativeExpresInterstitialAdDidLoad:(BUNativeExpressInterstitialAd *)interstitialAd;
  20. /**
  21. This method is called when interstitial ad material failed to load.
  22. @param error : the reason of error
  23. */
  24. - (void)nativeExpresInterstitialAd:(BUNativeExpressInterstitialAd *)interstitialAd didFailWithError:(NSError * __nullable)error;
  25. /**
  26. This method is called when rendering a nativeExpressAdView successed.
  27. */
  28. - (void)nativeExpresInterstitialAdRenderSuccess:(BUNativeExpressInterstitialAd *)interstitialAd;
  29. /**
  30. This method is called when a nativeExpressAdView failed to render.
  31. @param error : the reason of error
  32. */
  33. - (void)nativeExpresInterstitialAdRenderFail:(BUNativeExpressInterstitialAd *)interstitialAd error:(NSError * __nullable)error;
  34. /**
  35. This method is called when interstitial ad slot will be showing.
  36. */
  37. - (void)nativeExpresInterstitialAdWillVisible:(BUNativeExpressInterstitialAd *)interstitialAd;
  38. /**
  39. This method is called when interstitial ad is clicked.
  40. */
  41. - (void)nativeExpresInterstitialAdDidClick:(BUNativeExpressInterstitialAd *)interstitialAd;
  42. /**
  43. This method is called when interstitial ad is about to close.
  44. */
  45. - (void)nativeExpresInterstitialAdWillClose:(BUNativeExpressInterstitialAd *)interstitialAd;
  46. /**
  47. This method is called when interstitial ad is closed.
  48. */
  49. - (void)nativeExpresInterstitialAdDidClose:(BUNativeExpressInterstitialAd *)interstitialAd;
  50. /**
  51. This method is called when another controller has been closed.
  52. @param interactionType : open appstore in app or open the webpage or view video ad details page.
  53. */
  54. - (void)nativeExpresInterstitialAdDidCloseOtherController:(BUNativeExpressInterstitialAd *)interstitialAd interactionType:(BUInteractionType)interactionType;
  55. @end
  56. @interface BUNativeExpressInterstitialAd : NSObject <BUMopubAdMarkUpDelegate>
  57. @property (nonatomic, weak, nullable) id<BUNativeExpresInterstitialAdDelegate> delegate;
  58. @property (nonatomic, getter=isAdValid, readonly) BOOL adValid;
  59. /// media configuration parameters.
  60. @property (nonatomic, copy, readonly) NSDictionary *mediaExt;
  61. /**
  62. Initializes interstitial ad.
  63. @param slotID : The unique identifier of interstitial ad.
  64. @param adsize : custom size of ad view.
  65. @return BUNativeExpressInterstitialAd
  66. */
  67. - (instancetype)initWithSlotID:(NSString *)slotID adSize:(CGSize)adsize;
  68. /**
  69. Initializes express intersitial ad.
  70. @param slot A object, through which you can pass in the interstitial unique identifier, ad type, and so on
  71. @param adsize Customize the size of the view. Please make sure that the width and height passed in are available.
  72. @return BUNativeExpressInterstitialAd
  73. */
  74. - (instancetype)initWithSlot:(BUAdSlot *)slot adSize:(CGSize)adsize;
  75. /**
  76. Load interstitial ad datas.
  77. */
  78. - (void)loadAdData;
  79. /**
  80. Display interstitial ad.
  81. @param rootViewController : root view controller for displaying ad.
  82. @return : whether it is successfully displayed.
  83. */
  84. - (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
  85. @end
  86. NS_ASSUME_NONNULL_END