GADNativeContentAd.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // GADNativeContentAd.h
  3. // Google Mobile Ads SDK
  4. //
  5. // Copyright 2015 Google Inc. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import <UIKit/UIKit.h>
  9. #import "GADAdLoaderDelegate.h"
  10. #import "GADNativeAd.h"
  11. #import "GADNativeAdImage.h"
  12. #import "GoogleMobileAdsDefines.h"
  13. #pragma mark - Native Content Ad Assets
  14. /// For use with GADAdLoader's creation methods. If you request this ad type, your delegate must
  15. /// conform to the GADNativeContentAdRequestDelegate protocol.
  16. ///
  17. /// See GADNativeAdImageAdLoaderOptions.h for ad loader image options.
  18. GAD_EXTERN NSString *const kGADAdLoaderAdTypeNativeContent;
  19. /// Native content ad.
  20. @interface GADNativeContentAd : GADNativeAd
  21. #pragma mark - Must be displayed
  22. /// Primary text headline.
  23. @property(nonatomic, readonly, copy) NSString *headline;
  24. /// Secondary text.
  25. @property(nonatomic, readonly, copy) NSString *body;
  26. #pragma mark - Recommended to display
  27. /// Large images.
  28. @property(nonatomic, readonly, copy) NSArray *images;
  29. /// Small logo image.
  30. @property(nonatomic, readonly, strong) GADNativeAdImage *logo;
  31. /// Text that encourages user to take some action with the ad.
  32. @property(nonatomic, readonly, copy) NSString *callToAction;
  33. /// Identifies the advertiser. For example, the advertiser’s name or visible URL.
  34. @property(nonatomic, readonly, copy) NSString *advertiser;
  35. @end
  36. #pragma mark - Protocol and constants
  37. /// The delegate of a GADAdLoader object implements this protocol to receive GADNativeContentAd ads.
  38. @protocol GADNativeContentAdLoaderDelegate<GADAdLoaderDelegate>
  39. /// Called when native content is received.
  40. - (void)adLoader:(GADAdLoader *)adLoader
  41. didReceiveNativeContentAd:(GADNativeContentAd *)nativeContentAd;
  42. @end
  43. #pragma mark - Native Content Ad View
  44. /// Base class for content ad views. Your content ad view must be a subclass of this class and must
  45. /// call superclass methods for all overriden methods.
  46. @interface GADNativeContentAdView : UIView
  47. /// This property must point to the native content ad object rendered by this ad view.
  48. @property(nonatomic, strong) GADNativeContentAd *nativeContentAd;
  49. // Weak references to your ad view's asset views.
  50. @property(nonatomic, weak) IBOutlet UIView *headlineView;
  51. @property(nonatomic, weak) IBOutlet UIView *bodyView;
  52. @property(nonatomic, weak) IBOutlet UIView *imageView;
  53. @property(nonatomic, weak) IBOutlet UIView *logoView;
  54. @property(nonatomic, weak) IBOutlet UIView *callToActionView;
  55. @property(nonatomic, weak) IBOutlet UIView *advertiserView;
  56. @end