GADNativeAppInstallAd.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // GADNativeAppInstallAd.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. /// For use with GADAdLoader's creation methods. If you request this ad type, your delegate must
  14. /// conform to the GADNativeAppInstallAdRequestDelegate protocol.
  15. ///
  16. /// See GADNativeAdImageAdLoaderOptions.h for ad loader image options.
  17. GAD_EXTERN NSString *const kGADAdLoaderAdTypeNativeAppInstall;
  18. /// Native app install ad.
  19. @interface GADNativeAppInstallAd : GADNativeAd
  20. #pragma mark - Must be displayed
  21. /// App title.
  22. @property(nonatomic, readonly, copy) NSString *headline;
  23. /// Text that encourages user to take some action with the ad. For example "Install".
  24. @property(nonatomic, readonly, copy) NSString *callToAction;
  25. /// Application icon.
  26. @property(nonatomic, readonly, strong) GADNativeAdImage *icon;
  27. #pragma mark - Recommended to display
  28. /// App description.
  29. @property(nonatomic, readonly, copy) NSString *body;
  30. /// The app store name. For example, "App Store".
  31. @property(nonatomic, readonly, copy) NSString *store;
  32. /// String representation of the app's price.
  33. @property(nonatomic, readonly, copy) NSString *price;
  34. /// Array of GADNativeAdImage objects related to the advertised application.
  35. @property(nonatomic, readonly, strong) NSArray *images;
  36. /// App store rating (0 to 5).
  37. @property(nonatomic, readonly, copy) NSDecimalNumber *starRating;
  38. @end
  39. #pragma mark - Protocol and constants
  40. /// The delegate of a GADAdLoader object implements this protocol to receive GADNativeAppInstallAd
  41. /// ads.
  42. @protocol GADNativeAppInstallAdLoaderDelegate<GADAdLoaderDelegate>
  43. /// Called when a native app install ad is received.
  44. - (void)adLoader:(GADAdLoader *)adLoader
  45. didReceiveNativeAppInstallAd:(GADNativeAppInstallAd *)nativeAppInstallAd;
  46. @end
  47. #pragma mark - Native App Install Ad View
  48. /// Base class for app install ad views. Your app install ad view must be a subclass of this class
  49. /// and must call superclass methods for all overriden methods.
  50. @interface GADNativeAppInstallAdView : UIView
  51. /// This property must point to the native app install ad object rendered by this ad view.
  52. @property(nonatomic, strong) GADNativeAppInstallAd *nativeAppInstallAd;
  53. // Weak references to your ad view's asset views.
  54. @property(nonatomic, weak) IBOutlet UIView *headlineView;
  55. @property(nonatomic, weak) IBOutlet UIView *callToActionView;
  56. @property(nonatomic, weak) IBOutlet UIView *iconView;
  57. @property(nonatomic, weak) IBOutlet UIView *bodyView;
  58. @property(nonatomic, weak) IBOutlet UIView *storeView;
  59. @property(nonatomic, weak) IBOutlet UIView *priceView;
  60. @property(nonatomic, weak) IBOutlet UIView *imageView;
  61. @property(nonatomic, weak) IBOutlet UIView *starRatingView;
  62. @end