BUNativeAdsManager.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // BUNativeAdsManager.h
  3. // BUAdSDK
  4. //
  5. // Copyright © 2017 bytedance. All rights reserved.
  6. //
  7. /**
  8. BUNativeAdsManager : for multiple requests at the same time.
  9. */
  10. #import <Foundation/Foundation.h>
  11. #import <UIKit/UIKit.h>
  12. #import "BUAdSlot.h"
  13. #import "BUMaterialMeta.h"
  14. #import "BUNativeAd.h"
  15. #import "BUNativeExpressAdViewDelegate.h"
  16. @protocol BUNativeAdsManagerDelegate;
  17. NS_ASSUME_NONNULL_BEGIN
  18. /// Bunativeadsmanager class can request multiple ad data per time.
  19. @interface BUNativeAdsManager : NSObject <BUMopubAdMarkUpDelegate>
  20. @property (nonatomic, strong, nullable) BUAdSlot *adslot;
  21. @property (nonatomic, strong, nullable) NSArray<BUNativeAd *> *data;
  22. /// The delegate for receiving state change messages such as requests succeeding/failing.
  23. /// The delegate can be set to any object which conforming to <BUNativeAdsManagerDelegate>.
  24. @property (nonatomic, weak, nullable) id<BUNativeAdsManagerDelegate> delegate;
  25. /// The delegate for receiving messages when is render template
  26. @property (nonatomic, weak, nullable) id<BUNativeExpressAdViewDelegate> nativeExpressAdViewDelegate;
  27. /// Valid only in native Feed
  28. @property (nonatomic, assign, readwrite) CGSize adSize;
  29. - (instancetype)initWithSlot:(BUAdSlot * _Nullable) slot;
  30. /**
  31. It is recommended to request no more than 3 ads.
  32. The maximum is 10.
  33. */
  34. - (void)loadAdDataWithCount:(NSInteger)count;
  35. @end
  36. @protocol BUNativeAdsManagerDelegate <NSObject>
  37. @optional
  38. - (void)nativeAdsManagerSuccessToLoad:(BUNativeAdsManager *)adsManager nativeAds:(NSArray<BUNativeAd *> *_Nullable)nativeAdDataArray;
  39. - (void)nativeAdsManager:(BUNativeAdsManager *)adsManager didFailWithError:(NSError *_Nullable)error;
  40. @end
  41. NS_ASSUME_NONNULL_END