ALSdkInitializationConfiguration.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. //
  2. // ALSdkInitializationConfiguration.h
  3. // AppLovinSDK
  4. //
  5. // Created by Chris Cong on 1/22/24.
  6. //
  7. #import <AppLovinSDK/ALSdkSettings.h>
  8. #import <AppLovinSDK/ALTargetingData.h>
  9. #import <AppLovinSDK/ALUserSegment.h>
  10. @class ALSdkInitializationConfigurationBuilder;
  11. NS_ASSUME_NONNULL_BEGIN
  12. /**
  13. * Builder block used to create an ALSdkInitializationConfiguration object.
  14. */
  15. typedef void (^ALSdkInitializationConfigurationBuilderBlock) (ALSdkInitializationConfigurationBuilder *builder);
  16. /**
  17. * This class contains configurable properties and settings for the initialization of the AppLovin SDK.
  18. * It also reads any values you have already configured in the application's @c Info.plist.
  19. * To be used in @code [[ALSdk shared] initializeWithConfiguration:completionHandler].
  20. */
  21. @interface ALSdkInitializationConfiguration : NSObject
  22. @property (nonatomic, copy, readonly, nullable) NSString *sdkKey;
  23. @property (nonatomic, copy, readonly, nullable) NSString *mediationProvider;
  24. @property (nonatomic, copy, readonly, nullable) NSString *pluginVersion;
  25. @property (nonatomic, strong, readonly) ALSdkSettings *settings;
  26. @property (nonatomic, strong, readonly, nullable) ALUserSegment *userSegment;
  27. @property (nonatomic, strong, readonly, nullable) ALTargetingData *targetingData;
  28. @property (nonatomic, copy, readonly) NSArray<NSString *> *testDeviceAdvertisingIdentifiers;
  29. @property (nonatomic, copy, readonly) NSArray<NSString *> *adUnitIdentifiers;
  30. @property (nonatomic, assign, readonly, getter=isExceptionHandlerEnabled) BOOL exceptionHandlerEnabled;
  31. #pragma mark - Initialization
  32. /**
  33. * Creates a SDK initialization configuration object with the given SDK key.
  34. * Note: the properties on @c ALSdkInitializationConfiguration are immutable and must be configured on initialization in @c ALSdkInitializationConfigurationBuilder.
  35. */
  36. + (instancetype)configurationWithSdkKey:(NSString *)sdkKey;
  37. /**
  38. * Creates a SDK initialization configuration object constructed from the @c ALSdkInitializationConfigurationBuilder block.
  39. * You may modify the configuration from within the block.
  40. */
  41. + (instancetype)configurationWithSdkKey:(NSString *)sdkKey builderBlock:(nullable NS_NOESCAPE ALSdkInitializationConfigurationBuilderBlock)builderBlock;
  42. /**
  43. * Creates a builder object for @c ALSdkInitializationConfiguration.
  44. * Please call @c -build to create a @c ALSdkInitializationConfiguration object.
  45. *
  46. * @return a @c ALSdkInitializationConfigurationBuilder object.
  47. */
  48. + (ALSdkInitializationConfigurationBuilder *)builderWithSdkKey:(NSString *)sdkKey;
  49. - (instancetype)init NS_UNAVAILABLE;
  50. + (instancetype)new NS_UNAVAILABLE;
  51. @end
  52. #pragma mark - ALSdkInitializationConfiguration Builder
  53. /**
  54. * Builder class used to create an ALSdkInitializationConfiguration object.
  55. * This class contains configurable properties and settings for the initialization of the AppLovin SDK.
  56. */
  57. @interface ALSdkInitializationConfigurationBuilder : NSObject
  58. /**
  59. * @return SDK key for the AppLovin SDK.
  60. */
  61. @property (nonatomic, copy, readonly) NSString *sdkKey;
  62. /**
  63. * The mediation provider. Set this either by using one of the provided strings in ALMediationProvider.h, or your own string if you do not find an
  64. * applicable one there.
  65. */
  66. @property (nonatomic, copy, nullable) NSString *mediationProvider;
  67. /**
  68. * Sets the plugin version for the mediation adapter or plugin.
  69. */
  70. @property (nonatomic, copy, nullable) NSString *pluginVersion;
  71. /**
  72. * The settings object for the AppLovinSDK to initialize with. Note: its properties are mutable and may be modified after initialization.
  73. */
  74. @property (nonatomic, strong, readonly) ALSdkSettings *settings;
  75. /**
  76. * A user segment allows AppLovin to serve ads by using custom-defined rules that are based on which segment the user is in. The user segment is a custom string
  77. * of 32 alphanumeric characters or less.
  78. */
  79. @property (nonatomic, strong, nullable) ALUserSegment *userSegment;
  80. /**
  81. * A class which allows you to send any demographic or interest-based targeting data.
  82. */
  83. @property (nonatomic, strong, nullable) ALTargetingData *targetingData;
  84. /**
  85. * Enable devices to receive test ads by passing in the advertising identifier (IDFA or IDFV) of each test device.
  86. * Refer to AppLovin logs for the IDFA or IDFV of your current device.
  87. */
  88. @property (nonatomic, copy) NSArray<NSString *> *testDeviceAdvertisingIdentifiers;
  89. /**
  90. * The MAX ad unit IDs that you will use for this instance of the SDK. This initializes third-party SDKs with the credentials configured for these ad unit IDs.
  91. */
  92. @property (nonatomic, copy) NSArray<NSString *> *adUnitIdentifiers;
  93. /**
  94. * Whether or not the AppLovin SDK listens to exceptions. Defaults to @c YES.
  95. */
  96. @property (nonatomic, assign) BOOL exceptionHandlerEnabled;
  97. #pragma mark - Build
  98. /**
  99. * Builds a @c ALSdkInitializationConfiguration object from the builder properties' values.
  100. *
  101. * @return a @c ALSdkInitializationConfiguration object.
  102. */
  103. - (ALSdkInitializationConfiguration *)build;
  104. - (instancetype)init NS_UNAVAILABLE;
  105. + (instancetype)new NS_UNAVAILABLE;
  106. @end
  107. NS_ASSUME_NONNULL_END