-
Notifications
You must be signed in to change notification settings - Fork 299
/
Copy pathADJConfig.h
356 lines (302 loc) · 11.1 KB
/
ADJConfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
//
// ADJConfig.h
// adjust
//
// Created by Pedro Filipe on 30/10/14.
// Copyright (c) 2014 adjust GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
@class ADJLogger;
@class ADJAttribution;
@class ADJEventSuccess;
@class ADJEventFailure;
@class ADJSessionSuccess;
@class ADJSessionFailure;
typedef NS_ENUM(NSUInteger, ADJLogLevel);
#pragma mark - AdjustDelegate methods
/**
* @brief Optional delegate that will get informed about tracking results.
*/
@protocol AdjustDelegate
@optional
/**
* @brief Optional delegate method that gets called when the attribution information changed.
*
* @param attribution The attribution information.
*
* @note See ADJAttribution for details.
*/
- (void)adjustAttributionChanged:(nullable ADJAttribution *)attribution;
/**
* @brief Optional delegate method that gets called when an event is tracked with success.
*
* @param eventSuccessResponse The response information from tracking with success
*
* @note See ADJEventSuccess for details.
*/
- (void)adjustEventTrackingSucceeded:(nullable ADJEventSuccess *)eventSuccessResponse;
/**
* @brief Optional delegate method that gets called when an event is tracked with failure.
*
* @param eventFailureResponse The response information from tracking with failure
*
* @note See ADJEventFailure for details.
*/
- (void)adjustEventTrackingFailed:(nullable ADJEventFailure *)eventFailureResponse;
/**
* @brief Optional delegate method that gets called when a session is tracked with success.
*
* @param sessionSuccessResponse The response information from tracking with success
*
* @note See ADJSessionSuccess for details.
*/
- (void)adjustSessionTrackingSucceeded:(nullable ADJSessionSuccess *)sessionSuccessResponse;
/**
* @brief Optional delegate method that gets called when a session is tracked with failure.
*
* @param sessionFailureResponse The response information from tracking with failure
*
* @note See ADJSessionFailure for details.
*/
- (void)adjustSessionTrackingFailed:(nullable ADJSessionFailure *)sessionFailureResponse;
/**
* @brief Optional delegate method that gets called when a deferred deep link is about to be
* opened by the Adjust SDK.
*
* @param deeplink The deferred deep link URL that was received by the Adjust SDK to be opened.
*
* @return Boolean that indicates whether the deep link should be opened by the Adjust SDK or not.
*/
- (BOOL)adjustDeferredDeeplinkReceived:(nullable NSURL *)deeplink;
/**
* @brief Optional SKAdNetwork delegate method that gets called when Adjust SDK updates conversion
* value for the user.
* The conversionData dictionary will contain string representation for the values set by
* Adjust SDK and possible API invocation error.
* Avalable keys are "conversion_value", "coarse_value", "lock_window" and "error".
* Example: {"conversion_value":"1", "coarse_value":"low", "lock_window":"false"}
* You can use this callback even while using pre 4.0 SKAdNetwork.
* In that case the dictionary will contain only "conversion_value" key.
*
* @param data Conversion parameters set by Adjust SDK.
*/
- (void)adjustSkanUpdatedWithConversionData:(nonnull NSDictionary<NSString *, NSString *> *)data;
@end
/**
* @brief Adjust configuration object class.
*/
@interface ADJConfig : NSObject<NSCopying>
#pragma mark - ADJConfig readonly properties
/**
* @brief Adjust app token.
*/
@property (nonatomic, copy, readonly, nonnull) NSString *appToken;
/**
* @brief Adjust environment variable.
*/
@property (nonatomic, copy, readonly, nonnull) NSString *environment;
/**
* @brief Indicator of whether sending in the background is enabled or not.
*
* @note It is disabled by default.
*/
@property (nonatomic, readonly) BOOL isSendingInBackgroundEnabled;
/**
* @brief Indicator of whether reading of AdServices.framework data is enabled or not.
*
* @note It is enabled by default.
*/
@property (nonatomic, readonly) BOOL isAdServicesEnabled;
/**
* @brief Indicator of whether reading of IDFA is enabled or not.
*
* @note It is enabled by default.
*/
@property (nonatomic, readonly) BOOL isIdfaReadingEnabled;
/**
* @brief Indicator of whether reading of IDFV is enabled or not.
*
* @note It is enabled by default.
*/
@property (nonatomic, readonly) BOOL isIdfvReadingEnabled;
/**
* @brief Indicator of whether SKAdNetwork (SKAN) attribution is enabled or not.
*
* @note It is enabled by default.
*/
@property (nonatomic, readonly) BOOL isSkanAttributionEnabled;
/**
* @brief Set if cost data is needed in attribution response.
*
* @note It is disabled by default.
*/
@property (nonatomic, readonly) BOOL isCostDataInAttributionEnabled;
/**
* @brief Indicator of whether LinkMe feature is enabled or not.
*
* @note It is disabled by defailt.
*/
@property (nonatomic, readonly) BOOL isLinkMeEnabled;
/**
* @brief Enables caching of device IDs to read it only once.
*
* @note It is disabled by default.
*/
@property (nonatomic, readonly) BOOL isDeviceIdsReadingOnceEnabled;
/**
* @brief Array of domains to be used as part of the URL strategy.
*/
@property (nonatomic, copy, readonly, nullable) NSArray *urlStrategyDomains;
/**
* @brief Indicator of whether Adjust-like subdomains should be made out of custom set domains.
*/
@property (nonatomic, readonly) BOOL useSubdomains;
/**
* @brief Indicator of whether URL strategy is a data residency one or not.
*/
@property (nonatomic, readonly) BOOL isDataResidency;
/**
* @brief Indicator of whether SDK should start in COPPA compliant mode or not.
*/
@property (nonatomic, readonly) BOOL isCoppaComplianceEnabled;
#pragma mark - AdjustConfig assignable properties
/**
* @brief Set the optional delegate that will inform you about attribution or events.
*
* @note See the AdjustDelegate declaration above for details.
*/
@property (nonatomic, weak, nullable) NSObject<AdjustDelegate> *delegate;
/**
* @brief SDK prefix.
*
* @note Not to be used by users, intended for non-native adjust SDKs only.
*/
@property (nonatomic, copy, nullable) NSString *sdkPrefix;
/**
* @brief Change the verbosity of Adjust's logs.
*
* @note You can increase or reduce the amount of logs from Adjust by passing
* one of the following parameters. Use ADJLogLevelSuppress to disable all logging.
* The desired minimum log level (default: info)
* Must be one of the following:
* - ADJLogLevelVerbose (enable all logging)
* - ADJLogLevelDebug (enable more logging)
* - ADJLogLevelInfo (the default)
* - ADJLogLevelWarn (disable info logging)
* - ADJLogLevelError (disable warnings as well)
* - ADJLogLevelAssert (disable errors as well)
* - ADJLogLevelSuppress (suppress all logging)
*/
@property (nonatomic, assign) ADJLogLevel logLevel;
/**
* @brief Default tracker to attribute organic installs to (optional).
*/
@property (nonatomic, copy, nullable) NSString *defaultTracker;
/**
* @brief Custom defined unique device ID (optional).
*
* @note Make sure to have a UNIQUE external ID for each user / device.
*/
@property (nonatomic, copy, nullable) NSString *externalDeviceId;
/**
* @brief Define how many seconds to wait for ATT status before sending the first data.
*/
@property (nonatomic, assign) NSUInteger attConsentWaitingInterval;
/**
* @brief Maximum number of deduplication IDs to be stored by the SDK.
*
* @note If not set, maximum is 10.
*/
@property (nonatomic, assign) NSInteger eventDeduplicationIdsMaxSize;
# pragma mark - AdjustConfig construtors
/**
* @brief Get configuration object for the initialization of the Adjust SDK.
*
* @param appToken The App Token of your app. This unique identifier can
* be found it in your dashboard at http://adjust.com and should always
* be 12 characters long.
* @param environment The current environment your app. We use this environment to
* distinguish between real traffic and artificial traffic from test devices.
* It is very important that you keep this value meaningful at all times!
* Especially if you are tracking revenue.
*
* @returns Adjust configuration object.
*/
- (nullable ADJConfig *)initWithAppToken:(nonnull NSString *)appToken
environment:(nonnull NSString *)environment;
/**
* @brief Configuration object for the initialization of the Adjust SDK.
*
* @param appToken The App Token of your app. This unique identifier can
* be found it in your dashboard at http://adjust.com and should always
* be 12 characters long.
* @param environment The current environment your app. We use this environment to
* distinguish between real traffic and artificial traffic from test devices.
* It is very important that you keep this value meaningful at all times!
* Especially if you are tracking revenue.
* @param allowSuppressLogLevel If set to true, it allows usage of ADJLogLevelSuppress
* and replaces the default value for production environment.
*
* @returns Adjust configuration object.
*/
- (nullable ADJConfig *)initWithAppToken:(nonnull NSString *)appToken
environment:(nonnull NSString *)environment
suppressLogLevel:(BOOL)allowSuppressLogLevel;
#pragma mark - AdjustConfig instance methods
/**
* @brief Check if Adjust configuration object is valid.
*
* @return Boolean indicating whether Adjust config object is valid or not.
*/
- (BOOL)isValid;
/**
* @brief A method for disabling SDK's handling of AdServices.framework.
*/
- (void)disableAdServices;
/**
* @brief A method for disabling the reading of IDFA parameter.
*/
- (void)disableIdfaReading;
/**
* @brief A method for disabling the reading of IDFV parameter.
*/
- (void)disableIdfvReading;
/**
* @brief A method for disabling SKAdNetwork (SKAN) attribution.
*/
- (void)disableSkanAttribution;
/**
* @brief A method for enabling of sending in the background.
*/
- (void)enableSendingInBackground;
/**
* @brief A method to enable LinkMe feature.
*/
- (void)enableLinkMe;
/**
* @brief A method to enable reading of the device IDs just once.
*/
- (void)enableDeviceIdsReadingOnce;
/**
* @brief A method to enable obtaining of cost data inside of the attribution callback.
*/
- (void)enableCostDataInAttribution;
/**
* @brief A method to configure SDK to start in COPPA compliant mode.
*/
- (void)enableCoppaCompliance;
/**
* @brief A method to set custom URL strategy.
*
* @param urlStrategyDomains Array of domains to be used as part of the URL strategy.
* @param useSubdomains Array of domains to be used as part of the URL strategy.
* @param isDataResidency Indicator of whether URL strategy is a data residency one or not.
*
* @note If not set, by default SDK will attempt to send traffic to:
* - {analytics,consent}.adjust.com
* - {analytics,consent}.adjust.world
*/
- (void)setUrlStrategy:(nullable NSArray *)urlStrategyDomains
useSubdomains:(BOOL)useSubdomains
isDataResidency:(BOOL)isDataResidency;
@end