GADRequest.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. //
  2. // GADRequest.h
  3. // Google Mobile Ads SDK
  4. //
  5. // Copyright 2011 Google Inc. All rights reserved.
  6. //
  7. #import <CoreGraphics/CoreGraphics.h>
  8. #import <Foundation/Foundation.h>
  9. #import "GoogleMobileAdsDefines.h"
  10. /// Add this constant to the testDevices property's array to receive test ads on the simulator.
  11. GAD_EXTERN const id kGADSimulatorID;
  12. @protocol GADAdNetworkExtras;
  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. /// Returns a default request.
  22. + (instancetype)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. /// Returns the network extras defined for an ad network.
  32. - (id<GADAdNetworkExtras>)adNetworkExtrasFor:(Class<GADAdNetworkExtras>)aClass;
  33. /// Removes the extras for an ad network. |aClass| is the class which represents that network's
  34. /// extras type.
  35. - (void)removeAdNetworkExtrasFor:(Class<GADAdNetworkExtras>)aClass;
  36. #pragma mark Collecting SDK Information
  37. /// Returns the version of the SDK.
  38. + (NSString *)sdkVersion;
  39. #pragma mark Testing
  40. /// Test ads will be returned for devices with device IDs specified in this array.
  41. @property(nonatomic, copy) NSArray *testDevices;
  42. #pragma mark User Information
  43. /// Provide the user's gender to increase ad relevancy.
  44. @property(nonatomic, assign) GADGender gender;
  45. /// Provide the user's birthday to increase ad relevancy.
  46. @property(nonatomic, copy) NSDate *birthday;
  47. /// The user's current location may be used to deliver more relevant ads. However do not use Core
  48. /// Location just for advertising, make sure it is used for more beneficial reasons as well. It is
  49. /// both a good idea and part of Apple's guidelines.
  50. - (void)setLocationWithLatitude:(CGFloat)latitude
  51. longitude:(CGFloat)longitude
  52. accuracy:(CGFloat)accuracyInMeters;
  53. /// [Optional] This method allows you to specify whether you would like your app to be treated as
  54. /// child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA),
  55. /// http:///business.ftc.gov/privacy-and-security/childrens-privacy.
  56. ///
  57. /// If you call this method with YES, you are indicating that your app should be treated as
  58. /// child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA). If you call
  59. /// this method with NO, you are indicating that your app should not be treated as child-directed
  60. /// for purposes of the Children’s Online Privacy Protection Act (COPPA). If you do not call this
  61. /// method, ad requests will include no indication of how you would like your app treated with
  62. /// respect to COPPA.
  63. ///
  64. /// By setting this method, you certify that this notification is accurate and you are authorized to
  65. /// act on behalf of the owner of the app. You understand that abuse of this setting may result in
  66. /// termination of your Google account.
  67. ///
  68. /// It may take some time for this designation to be fully implemented in applicable Google
  69. /// services. This designation will only apply to ad requests for which you have set this method.
  70. - (void)tagForChildDirectedTreatment:(BOOL)childDirectedTreatment;
  71. #pragma mark Contextual Information
  72. /// Array of keyword strings. Keywords are words or phrases describing the current user activity
  73. /// such as @"Sports Scores" or @"Football". Set this property to nil to clear the keywords.
  74. @property(nonatomic, copy) NSArray *keywords;
  75. /// URL string for a webpage whose content matches the app content. This webpage content is used for
  76. /// targeting purposes.
  77. @property(nonatomic, copy) NSString *contentURL;
  78. #pragma mark Request Agent Information
  79. /// String that identifies the ad request's origin. Third party libraries that reference the Mobile
  80. /// Ads SDK should set this property to denote the platform from which the ad request originated.
  81. /// For example, a third party ad network called "CoolAds network" that is mediating requests to the
  82. /// Mobile Ads SDK should set this property as "CoolAds".
  83. @property(nonatomic, copy) NSString *requestAgent;
  84. #pragma mark Deprecated Methods
  85. /// Provide the user's birthday to increase ad relevancy.
  86. - (void)setBirthdayWithMonth:(NSInteger)month
  87. day:(NSInteger)day
  88. year:(NSInteger)year
  89. GAD_DEPRECATED_MSG_ATTRIBUTE(" use the birthday property.");
  90. /// When Core Location isn't available but the user's location is known supplying it here may
  91. /// deliver more relevant ads. It can be any free-form text such as @"Champs-Elysees Paris" or
  92. /// @"94041 US".
  93. - (void)setLocationWithDescription:(NSString *)locationDescription
  94. GAD_DEPRECATED_MSG_ATTRIBUTE(" use setLocationWithLatitude:longitude:accuracy:.");
  95. @end