ADCDN_SplashAdManagerView.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // ADCDN_SplashAdManagerView.h
  3. // ADCDN
  4. //
  5. // Created by 吃不胖的瘦子 on 2021/2/23.
  6. // Copyright © 2021 llh. All rights reserved.
  7. // 开屏广告
  8. #import <UIKit/UIKit.h>
  9. @class ADCDN_SplashAdManagerView;
  10. /**
  11. * 代理协议方法
  12. */
  13. @protocol ADCDN_SplashAdManagerViewDelegate <NSObject>
  14. @optional
  15. /**
  16. * 开屏广告成功展示
  17. */
  18. - (void)ADCDN_SplashAdSuccessPresentScreen:(ADCDN_SplashAdManagerView *_Nullable)splashAd;
  19. /**
  20. * 开屏广告展示失败
  21. */
  22. - (void)ADCDN_SplashAdFailToPresent:(ADCDN_SplashAdManagerView *_Nullable)splashAd withError:(NSError *_Nullable)error;
  23. /**
  24. * 开屏广告曝光回调
  25. */
  26. - (void)ADCDN_SplashAdExposured:(ADCDN_SplashAdManagerView *_Nullable)splashAd;
  27. /**
  28. * 开屏广告点击回调
  29. */
  30. - (void)ADCDN_SplashAdClicked:(ADCDN_SplashAdManagerView *_Nullable)splashAd;
  31. /**
  32. * 开屏广告关闭回调
  33. */
  34. - (void)ADCDN_SplashAdClosed:(ADCDN_SplashAdManagerView *_Nullable)splashAd;
  35. /**
  36. * 开屏广告将要关闭回调
  37. */
  38. - (void)ADCDN_SplashAdWillClosed:(ADCDN_SplashAdManagerView *_Nullable)splashAd;
  39. /**
  40. * 开屏详情页关闭回调
  41. */
  42. - (void)ADCDN_SplashAdDetailClosed:(ADCDN_SplashAdManagerView *_Nullable)splashAd;
  43. @end
  44. @interface ADCDN_SplashAdManagerView : UIView
  45. // keyWindow
  46. @property (nonatomic, weak)UIWindow * _Nullable window;
  47. // 代理对象
  48. @property (nonatomic, weak) id <ADCDN_SplashAdManagerViewDelegate> _Nullable delegate;
  49. // 控制器
  50. @property (nonatomic, weak)UIViewController * _Nullable rootViewController;
  51. @property (nonatomic,assign) CGRect viewframe;
  52. /**
  53. * [可选],兜底图,防止开屏广告材料还没拉取到,会有白屏展示,建议:兜底可以设置为启动图。
  54. */
  55. @property (nonatomic, strong)UIView * _Nullable bottomView;
  56. /**
  57. * 广告发起请求并展示在Window中, 同时在屏幕底部设置应用自身的Logo页面或是自定义View
  58. * 详解:[可选],发起拉取广告请求,并将获取的广告以半屏形式展示在传入的Window的上半部,剩余部分展示传入的logoView
  59. * 请注意:1.logoView需设置好宽高,所占的空间不能过大,并保证高度不超过屏幕高度的 25%。2.Splash广告只支持竖屏
  60. * logoView 自定义底部View,可以在此View中设置应用Logo
  61. */
  62. @property (nonatomic, strong)UIView * _Nullable logoView;
  63. /**
  64. * plcId - 广告位 ID
  65. */
  66. -(instancetype _Nullable)initWithFrame:(CGRect)frame plcId:(NSString *_Nullable)plcId;
  67. /**
  68. * 加载开屏广告
  69. */
  70. -(void)loadSplashAd;
  71. @end