ADCDN_NativeExpressAdManager.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // ADCDN_NativeExpressAdManager.h
  3. // ADCDN
  4. //
  5. // Created by 吃不胖的瘦子 on 2021/2/23.
  6. // Copyright © 2021 llh. All rights reserved.
  7. // 原生广告
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. @class ADCDN_NativeExpressAdManager;
  12. /**
  13. * 代理协议方法
  14. */
  15. @protocol ADCDN_NativeExpressAdManagerDelegate <NSObject>
  16. /**
  17. * 拉取广告成功
  18. */
  19. - (void)ADCDN_NativeExpressAdSuccessToLoad:(ADCDN_NativeExpressAdManager *)nativeExpressAd views:(NSArray<__kindof UIView *> *)views;
  20. /**
  21. * 拉取广告失败
  22. */
  23. - (void)ADCDN_NativeExpressAd:(ADCDN_NativeExpressAdManager *)nativeExpressAd didFailWithError:(NSError *_Nullable)error;
  24. /**
  25. * 渲染广告成功
  26. */
  27. - (void)ADCDN_NativeExpressAdRenderSuccess:(UIView *)nativeExpressAdView;
  28. /**
  29. * 渲染广告失败
  30. */
  31. - (void)ADCDN_NativeExpressAdRenderFail:(UIView *)nativeExpressAdView error:(NSError *_Nullable)error;
  32. /**
  33. * 点击广告
  34. */
  35. - (void)ADCDN_NativeExpressAdDidClick:(UIView *)nativeExpressAdView;
  36. /**
  37. * 曝光回调
  38. */
  39. - (void)ADCDN_NativeExpressAdDidBecomeVisible:(UIView *)nativeExpressAdView;
  40. /**
  41. * 关闭广告回调
  42. */
  43. - (void)ADCDN_NativeExpressAdDidClose:(UIView *)nativeExpressAdView;
  44. @end
  45. @interface ADCDN_NativeExpressAdManager : NSObject
  46. // 控制器
  47. @property (nonatomic, weak)UIViewController *rootViewController;
  48. // 代理对象
  49. @property (nonatomic, weak, nullable) id<ADCDN_NativeExpressAdManagerDelegate> delegate;
  50. // 广告尺寸大小,建议尺寸:1280 * 720
  51. @property (nonatomic,assign) CGSize adSize;
  52. // 请求广告的数量,一次性请求的最大值为max = 3
  53. @property (nonatomic,assign) NSInteger adCount;
  54. /**
  55. * plcId - 广告位 ID
  56. */
  57. -(instancetype _Nullable)initWithPlcId:(NSString *_Nullable)plcId;
  58. /**
  59. * 加载广告
  60. */
  61. -(void)loadAd;
  62. /**
  63. * 渲染
  64. */
  65. -(void)render:(UIView *)nativeExpressAdview;
  66. @end
  67. NS_ASSUME_NONNULL_END