ALTargetingData.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. //
  2. // ALTargetingData.h
  3. // sdk
  4. //
  5. // Created by Basil on 9/18/12.
  6. // Copyright © 2022 AppLovin Corporation. All rights reserved.
  7. //
  8. @class ALTargetingDataBuilder;
  9. NS_ASSUME_NONNULL_BEGIN
  10. /**
  11. * Builder block used to create an ALSdkInitializationConfiguration object.
  12. */
  13. typedef void (^ALTargetingDataBuilderBlock) (ALTargetingDataBuilder *builder);
  14. /**
  15. * This enumeration represents content ratings for the ads shown to users.
  16. * They correspond to IQG Media Ratings.
  17. */
  18. typedef NS_ENUM(NSInteger, ALAdContentRating)
  19. {
  20. ALAdContentRatingNone,
  21. ALAdContentRatingAllAudiences,
  22. ALAdContentRatingEveryoneOverTwelve,
  23. ALAdContentRatingMatureAudiences
  24. };
  25. /**
  26. * This enumeration represents gender.
  27. */
  28. typedef NS_ENUM(NSInteger, ALGender)
  29. {
  30. ALGenderUnknown,
  31. ALGenderFemale,
  32. ALGenderMale,
  33. ALGenderOther
  34. };
  35. /**
  36. * This class allows you to provide user or app data that will improve how we target ads.
  37. */
  38. @interface ALTargetingData : NSObject
  39. @property (nonatomic, assign) ALGender gender __deprecated_msg("This setter is deprecated and will be removed in a future SDK version. Please build a ALTargetingData instance in ALSdkInitializationConfiguration");
  40. @property (nonatomic, assign) ALAdContentRating maximumAdContentRating __deprecated_msg("This setter is deprecated and will be removed in a future SDK version. Please build a ALTargetingData instance in ALSdkInitializationConfiguration");
  41. @property (nonatomic, strong, nullable) NSNumber *yearOfBirth __deprecated_msg("This setter is deprecated and will be removed in a future SDK version. Please build a ALTargetingData instance in ALSdkInitializationConfiguration");
  42. @property (nonatomic, copy, nullable) NSString *email __deprecated_msg("This setter is deprecated and will be removed in a future SDK version. Please build a ALTargetingData instance in ALSdkInitializationConfiguration");
  43. @property (nonatomic, copy, nullable) NSString *phoneNumber __deprecated_msg("This setter is deprecated and will be removed in a future SDK version. Please build a ALTargetingData instance in ALSdkInitializationConfiguration");
  44. @property (nonatomic, copy, nullable) NSArray<NSString *> *keywords __deprecated_msg("This setter is deprecated and will be removed in a future SDK version. Please build a ALTargetingData instance in ALSdkInitializationConfiguration");
  45. @property (nonatomic, copy, nullable) NSArray<NSString *> *interests __deprecated_msg("This setter is deprecated and will be removed in a future SDK version. Please build a ALTargetingData instance in ALSdkInitializationConfiguration");
  46. - (void)clearAll __deprecated_msg("This method is deprecated and will be removed in a future SDK version.");
  47. #pragma mark - Initialization
  48. /**
  49. * Creates a @c ALTargetingData object from the builder in the builderBlock.
  50. *
  51. * @return a @c ALTargetingData object.
  52. */
  53. + (instancetype)dataWithBuilderBlock:(NS_NOESCAPE ALTargetingDataBuilderBlock)builderBlock;
  54. /**
  55. * Creates a builder object for @c ALTargetingData.
  56. * Please call @c -build to create a @c ALTargetingData object.
  57. *
  58. * @return a @c ALTargetingDataBuilder object.
  59. */
  60. + (ALTargetingDataBuilder *)builder;
  61. - (instancetype)init __attribute__((unavailable("Please create a ALTargetingData instance in ALSdkInitializationConfiguration")));
  62. - (instancetype)new NS_UNAVAILABLE;
  63. @end
  64. #pragma mark - ALTargetingData Builder
  65. /**
  66. * Builder class used to create an ALTargetingData object.
  67. */
  68. @interface ALTargetingDataBuilder : NSObject
  69. /**
  70. * The year of birth of the user.
  71. * Set this property to @c nil to clear this value.
  72. */
  73. @property (nonatomic, strong, nullable) NSNumber *yearOfBirth;
  74. /**
  75. * The gender of the user.
  76. * Set this property to @c ALGenderUnknown to clear this value.
  77. */
  78. @property (nonatomic, assign) ALGender gender;
  79. /**
  80. * The maximum ad content rating shown to the user.
  81. * Set this property to @c ALAdContentRatingNone to clear this value.
  82. */
  83. @property (nonatomic, assign) ALAdContentRating maximumAdContentRating;
  84. /**
  85. * The email of the user.
  86. * Set this property to @c nil to clear this value.
  87. */
  88. @property (nonatomic, copy, nullable) NSString *email;
  89. /**
  90. * The phone number of the user. Do not include the country calling code.
  91. * Set this property to @c nil to clear this value.
  92. */
  93. @property (nonatomic, copy, nullable) NSString *phoneNumber;
  94. /**
  95. * The keywords describing the application.
  96. * Set this property to @c nil to clear this value.
  97. */
  98. @property (nonatomic, copy, nullable) NSArray<NSString *> *keywords;
  99. /**
  100. * The interests of the user.
  101. * Set this property to @c nil to clear this value.
  102. */
  103. @property (nonatomic, copy, nullable) NSArray<NSString *> *interests;
  104. #pragma mark - Build
  105. /**
  106. * Builds a @c ALTargetingData object from the builder properties' values.
  107. *
  108. * @return a @c ALTargetingData object.
  109. */
  110. - (ALTargetingData *)build;
  111. - (instancetype)init NS_UNAVAILABLE;
  112. + (instancetype)new NS_UNAVAILABLE;
  113. @end
  114. NS_ASSUME_NONNULL_END