GADRequest.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //
  2. // GADRequest.h
  3. // Google AdMob Ads SDK
  4. //
  5. // Copyright 2011 Google Inc. All rights reserved.
  6. //
  7. #import <CoreGraphics/CoreGraphics.h>
  8. #import <Foundation/Foundation.h>
  9. #import "GADModules.h"
  10. @protocol GADAdNetworkExtras;
  11. /// Constant for getting test ads on the simulator using the testDevices method.
  12. #define GAD_SIMULATOR_ID @"Simulator"
  13. /// Genders to help deliver more relevant ads.
  14. typedef NS_ENUM(NSInteger, GADGender) {
  15. kGADGenderUnknown, ///< Unknown gender.
  16. kGADGenderMale, ///< Male gender.
  17. kGADGenderFemale ///< Female gender.
  18. };
  19. /// Specifies optional parameters for ad requests.
  20. @interface GADRequest : NSObject<NSCopying>
  21. /// Creates an autoreleased GADRequest.
  22. + (GADRequest *)request;
  23. #pragma mark Additional Parameters For Ad Networks
  24. /// Ad networks may have additional parameters they accept. To pass these parameters to them, create
  25. /// the ad network extras object for that network, fill in the parameters, and register it here. The
  26. /// ad network should have a header defining the interface for the 'extras' object to create. All
  27. /// networks will have access to the basic settings you've set in this GADRequest (gender, birthday,
  28. /// testing mode, etc.). If you register an extras object that is the same class as one you have
  29. /// registered before, the previous extras will be overwritten.
  30. - (void)registerAdNetworkExtras:(id<GADAdNetworkExtras>)extras;
  31. /// Get the network extras defined for an ad network.
  32. - (id<GADAdNetworkExtras>)adNetworkExtrasFor:(Class<GADAdNetworkExtras>)aClass;
  33. /// Unsets the extras for an ad network. |clazz| is the class which represents that network's extras
  34. /// type.
  35. - (void)removeAdNetworkExtrasFor:(Class<GADAdNetworkExtras>)aClass;
  36. /// Extras sent to the mediation server (if using Mediation). For future use.
  37. @property(nonatomic, copy) NSDictionary *mediationExtras;
  38. #pragma mark Collecting SDK Information
  39. /// Returns the version of the SDK.
  40. + (NSString *)sdkVersion;
  41. #pragma mark Testing
  42. /// Add the device's identifier into this array for testing purposes.
  43. @property(nonatomic, copy) NSArray *testDevices;
  44. #pragma mark User Information
  45. /// The user's gender may be used to deliver more relevant ads.
  46. @property(nonatomic, assign) GADGender gender;
  47. /// The user's birthday may be used to deliver more relevant ads.
  48. @property(nonatomic, strong) NSDate *birthday;
  49. - (void)setBirthdayWithMonth:(NSInteger)m day:(NSInteger)d year:(NSInteger)y;
  50. /// The user's current location may be used to deliver more relevant ads. However do not use Core
  51. /// Location just for advertising, make sure it is used for more beneficial reasons as well. It is
  52. /// both a good idea and part of Apple's guidelines.
  53. - (void)setLocationWithLatitude:(CGFloat)latitude
  54. longitude:(CGFloat)longitude
  55. accuracy:(CGFloat)accuracyInMeters;
  56. /// When Core Location isn't available but the user's location is known supplying it here may
  57. /// deliver more relevant ads. It can be any free-form text such as @"Champs-Elysees Paris" or
  58. /// @"94041 US".
  59. - (void)setLocationWithDescription:(NSString *)locationDescription;
  60. /// [Optional] This method allows you to specify whether you would like your app to be treated as
  61. /// child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA),
  62. /// http:///business.ftc.gov/privacy-and-security/childrens-privacy.
  63. ///
  64. /// If you call this method with YES, you are indicating that your app should be treated as
  65. /// child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA). If you call
  66. /// this method with NO, you are indicating that your app should not be treated as child-directed
  67. /// for purposes of the Children’s Online Privacy Protection Act (COPPA). If you do not call this
  68. /// method, ad requests will include no indication of how you would like your app treated with
  69. /// respect to COPPA.
  70. ///
  71. /// By setting this method, you certify that this notification is accurate and you are authorized to
  72. /// act on behalf of the owner of the app. You understand that abuse of this setting may result in
  73. /// termination of your Google account.
  74. ///
  75. /// It may take some time for this designation to be fully implemented in applicable Google
  76. /// services. This designation will only apply to ad requests for which you have set this method.
  77. - (void)tagForChildDirectedTreatment:(BOOL)childDirectedTreatment;
  78. #pragma mark Contextual Information
  79. /// A keyword is a word or phrase describing the current activity of the user such as @"Sports
  80. /// Scores". Each keyword is an NSString in the NSArray. To clear the keywords set this to nil.
  81. @property(nonatomic, strong) NSMutableArray *keywords;
  82. /// Convenience method for adding keywords one at a time such as @"Sports Scores" and then
  83. /// @"Football".
  84. - (void)addKeyword:(NSString *)keyword;
  85. #pragma mark - Deprecated Methods
  86. /// Accesses the additionalParameters for the "GoogleAdmob" ad network. Please use
  87. /// -registerAdNetworkExtras: method above and pass an instance of GADAdMobExtras instead.
  88. @property(nonatomic, copy) NSDictionary *additionalParameters __attribute__((
  89. deprecated(" use registerAdNetworkExtras: and pass an instance of GADAdMobExtras.")));
  90. /// This property has been deprecated with the latest SDK releases. Please use testDevices.
  91. @property(nonatomic, assign, getter=isTesting) BOOL testing
  92. __attribute__((deprecated(" use the testDevices property.")));
  93. @end