GDTHybridAd.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // GDTHybridAd.h
  3. // GDTMobApp
  4. //
  5. // Created by royqpwang on 2019/3/8.
  6. // Copyright © 2019 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. typedef NS_OPTIONS(NSInteger, GDTHybridAdOptions) {
  11. GDTHybridAdOptionRewardVideo = 1 << 0
  12. };
  13. @class GDTHybridAd;
  14. @protocol GDTHybridAdDelegate <NSObject>
  15. @optional
  16. - (void)gdt_hybridAdDidPresented:(GDTHybridAd *)hybridAd;
  17. - (void)gdt_hybridAdDidClose:(GDTHybridAd *)hybridAd;
  18. - (void)gdt_hybridAdLoadURLSuccess:(GDTHybridAd *)hybridAd;
  19. - (void)gdt_hybridAd:(GDTHybridAd *)hybridAd didFailWithError:(NSError *)error;
  20. @end
  21. @interface GDTHybridAd : NSObject
  22. /**
  23. 自定义浏览器 UI 属性,请在 showWithRootViewController: 方法前设置。
  24. */
  25. @property (nonatomic, copy) NSString *titleContent;
  26. @property (nonatomic, strong) UIColor *titleColor;
  27. @property (nonatomic, strong) UIFont *titleFont;
  28. @property (nonatomic, strong) UIColor *navigationBarColor;
  29. @property (nonatomic, strong) UIColor *navigationBarBottomColor;
  30. @property (nonatomic, strong) UIColor *separatorLineColor;
  31. @property (nonatomic, strong) UIImage *closeImage; // 如需自定义关闭图片,请按 44*44 大小设置
  32. @property (nonatomic, strong) UIImage *backImage; // 如需自定义后退图片,请按 44*44 大小设置
  33. /**
  34. 委托对象
  35. */
  36. @property (nonatomic, weak) id <GDTHybridAdDelegate> delegate;
  37. /**
  38. 构造方法
  39. @param adOptions - 支持的广告类型 Options,激励视频请传 GDTHybridAdOptionRewardVideo
  40. @return GDTHybrid 实例
  41. */
  42. - (instancetype)initWithType:(GDTHybridAdOptions)adOptions;
  43. /**
  44. 加载广告方法 支持 iOS8.1 及以上系统
  45. @param url 加载的 X 中心 URL
  46. */
  47. - (void)loadWithUrl:(NSString *)url;
  48. /**
  49. 展示浏览器方法
  50. @param rootViewController 用于 present 浏览器 VC
  51. */
  52. - (void)showWithRootViewController:(UIViewController *)rootViewController;
  53. @end
  54. NS_ASSUME_NONNULL_END