ALSdkConfiguration.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. //
  2. // ALSdkConfiguration.h
  3. // AppLovinSDK
  4. //
  5. // Created by Thomas So on 9/29/18.
  6. // Copyright © 2020 AppLovin Corporation. All rights reserved.
  7. //
  8. NS_ASSUME_NONNULL_BEGIN
  9. /**
  10. * This class contains various properties of the AppLovin SDK configuration.
  11. */
  12. @interface ALSdkConfiguration : NSObject
  13. /**
  14. * This enum represents the user's geography used to determine the type of consent flow shown to the user.
  15. */
  16. typedef NS_ENUM(NSInteger, ALConsentFlowUserGeography)
  17. {
  18. /**
  19. * User's geography is unknown.
  20. */
  21. ALConsentFlowUserGeographyUnknown,
  22. /**
  23. * The user is in GDPR region.
  24. */
  25. ALConsentFlowUserGeographyGDPR,
  26. /**
  27. * The user is in a non-GDPR region.
  28. */
  29. ALConsentFlowUserGeographyOther
  30. };
  31. /**
  32. * AppLovin SDK-defined app tracking transparency status values (extended to include "unavailable" state on iOS before iOS14).
  33. */
  34. typedef NS_ENUM(NSInteger, ALAppTrackingTransparencyStatus)
  35. {
  36. /**
  37. * Device is on iOS before iOS14, AppTrackingTransparency.framework is not available.
  38. */
  39. ALAppTrackingTransparencyStatusUnavailable = -1,
  40. /**
  41. * The user has not yet received an authorization request to authorize access to app-related data that can be used for tracking the user or the device.
  42. */
  43. ALAppTrackingTransparencyStatusNotDetermined,
  44. /**
  45. * Authorization to access app-related data that can be used for tracking the user or the device is restricted.
  46. */
  47. ALAppTrackingTransparencyStatusRestricted,
  48. /**
  49. * The user denies authorization to access app-related data that can be used for tracking the user or the device.
  50. */
  51. ALAppTrackingTransparencyStatusDenied,
  52. /**
  53. * The user authorizes access to app-related data that can be used for tracking the user or the device.
  54. */
  55. ALAppTrackingTransparencyStatusAuthorized
  56. };
  57. /**
  58. * Get the user's geography used to determine the type of consent flow shown to the user.
  59. * If no such determination could be made, @c ALConsentFlowUserGeographyUnknown will be returned.
  60. */
  61. @property (nonatomic, assign, readonly) ALConsentFlowUserGeography consentFlowUserGeography;
  62. /**
  63. * Gets the country code for this user. The value of this property will be an empty string if no country code is available for this user.
  64. *
  65. * @warning Do not confuse this with the <em>currency</em> code which is "USD" in most cases.
  66. */
  67. @property (nonatomic, copy, readonly) NSString *countryCode;
  68. /**
  69. * Get the list of those Ad Unit IDs that are in the waterfall that is currently active for a particular user and
  70. * for which Amazon Publisher Services is enabled.
  71. *
  72. * Which waterfall is currently active for a user depends on things like A/B tests, keyword targeting, or DNT.
  73. *
  74. * @return @c nil when configuration fetching fails (e.g. in the case of no connection) or
  75. * an empty array if no Ad Unit IDs have Amazon Publisher Services enabled.
  76. */
  77. @property (nonatomic, strong, readonly, nullable) NSArray<NSString *> *enabledAmazonAdUnitIdentifiers;
  78. /**
  79. * Indicates whether or not the user authorizes access to app-related data that can be used for tracking the user or the device.
  80. *
  81. * @warning Users can revoke permission at any time through the "Allow Apps To Request To Track" privacy setting on the device.
  82. */
  83. @property (nonatomic, assign, readonly) ALAppTrackingTransparencyStatus appTrackingTransparencyStatus;
  84. - (instancetype)init NS_UNAVAILABLE;
  85. + (instancetype)new NS_UNAVAILABLE;
  86. /**
  87. * Whether or not test mode is enabled for this session.
  88. *
  89. * @return @c YES in one of the following cases:
  90. * <ul>
  91. * <li> 1. @code ALSdkInitializationConfiguration.testDeviceAdvertisingIdentifiers @endcode was set with current device's IDFA prior to SDK initialization.</li>
  92. * <li> 2. Current device was registered as a test device through MAX dashboard -> MAX Test Devices prior to SDK initialization.</li>
  93. * <li> 3. Test mode was manually enabled for this session through the Mediation Debugger during the last session.</li>
  94. * <li> 4. Current device is a simulator.</li>
  95. * </ul>
  96. */
  97. @property (nonatomic, assign, readonly, getter=isTestModeEnabled) BOOL testModeEnabled;
  98. @end
  99. NS_ASSUME_NONNULL_END
  100. __attribute__((deprecated))
  101. typedef NS_ENUM(NSInteger, ALConsentDialogState)
  102. {
  103. ALConsentDialogStateUnknown,
  104. ALConsentDialogStateApplies,
  105. ALConsentDialogStateDoesNotApply
  106. };
  107. @interface ALSdkConfiguration (ALDeprecated)
  108. @property (nonatomic, assign, readonly) ALConsentDialogState consentDialogState __deprecated_msg("This API has been deprecated and will be removed in a future release.");
  109. @end