DFPBannerView.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // DFPBannerView.h
  3. // Google Mobile Ads SDK
  4. //
  5. // Copyright 2012 Google Inc. All rights reserved.
  6. //
  7. #import "GADBannerView.h"
  8. #import "GADCorrelator.h"
  9. #import "GoogleMobileAdsDefines.h"
  10. @protocol DFPCustomRenderedBannerViewDelegate;
  11. @protocol GADAdSizeDelegate;
  12. @protocol GADAppEventDelegate;
  13. /// The view that displays DoubleClick For Publishers banner ads.
  14. @interface DFPBannerView : GADBannerView
  15. /// Required value created on the DFP website. Create a new ad unit for every unique placement of an
  16. /// ad in your application. Set this to the ID assigned for this placement. Ad units are important
  17. /// for targeting and statistics.
  18. ///
  19. /// Example DFP ad unit ID: @"/6499/example/banner"
  20. @property(nonatomic, copy) NSString *adUnitID;
  21. /// Optional delegate that is notified when creatives send app events.
  22. @property(nonatomic, weak) IBOutlet id<GADAppEventDelegate> appEventDelegate;
  23. /// Optional delegate that is notified when creatives cause the banner to change size. To avoid
  24. /// crashing the app, remember to nil this property before releasing the object that implements the
  25. /// GADAdSizeDelegate protocol.
  26. @property(nonatomic, weak) IBOutlet id<GADAdSizeDelegate> adSizeDelegate;
  27. /// Optional array of NSValue encoded GADAdSize structs, specifying all valid sizes that are
  28. /// appropriate for this slot. Never create your own GADAdSize directly. Use one of the predefined
  29. /// standard ad sizes (such as kGADAdSizeBanner), or create one using the GADAdSizeFromCGSize
  30. /// method.
  31. ///
  32. /// \see setValidAdSizesWithSizes:
  33. ///
  34. /// Example:
  35. /// \code
  36. /// NSArray *validSizes = @[
  37. /// NSValueFromGADAdSize(kGADAdSizeBanner),
  38. /// NSValueFromGADAdSize(kGADAdSizeLargeBanner)
  39. /// ];
  40. ///
  41. /// bannerView.validAdSizes = validSizes;
  42. /// \endcode
  43. @property(nonatomic, copy) NSArray *validAdSizes;
  44. /// Correlator object for correlating this object to other ad objects.
  45. @property(nonatomic, strong) GADCorrelator *correlator;
  46. /// Indicates that the publisher will record impressions manually when the ad becomes visible to the
  47. /// user.
  48. @property(nonatomic, assign) BOOL enableManualImpressions;
  49. /// Optional delegate object for custom rendered ads.
  50. @property(nonatomic, weak)
  51. IBOutlet id<DFPCustomRenderedBannerViewDelegate> customRenderedBannerViewDelegate;
  52. /// If you've set enableManualImpressions to YES, call this method when the ad is visible.
  53. - (void)recordImpression;
  54. /// Use this function to resize the banner view without launching a new ad request.
  55. - (void)resize:(GADAdSize)size;
  56. #pragma mark Deprecated
  57. /// Sets the receiver's valid ad sizes to the values pointed to by the provided NULL terminated list
  58. /// of GADAdSize pointers.
  59. ///
  60. /// Example:
  61. /// \code
  62. /// GADAdSize size1 = kGADAdSizeBanner;
  63. /// GADAdSize size2 = kGADAdSizeLargeBanner;
  64. /// [bannerView setValidAdSizesWithSizes:&size1, &size2, NULL];
  65. /// \endcode
  66. - (void)setValidAdSizesWithSizes:(GADAdSize *)firstSize, ... NS_REQUIRES_NIL_TERMINATION
  67. GAD_DEPRECATED_MSG_ATTRIBUTE("Use validAdSizes property.");
  68. @end