@convivainc/conviva-react-native-appanalytics 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/ConvivaLegalNotice.txt +1 -0
- package/README.md +104 -0
- package/index.d.ts +842 -0
- package/index.js +1860 -0
- package/package.json +22 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,842 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HttpMethod type
|
|
3
|
+
*/
|
|
4
|
+
type HttpMethod = 'post' | 'get';
|
|
5
|
+
/**
|
|
6
|
+
* DevicePlatform type
|
|
7
|
+
*/
|
|
8
|
+
type DevicePlatform = 'web' | 'mob' | 'pc' | 'srv' | 'app' | 'tv' | 'cnsl' | 'iot';
|
|
9
|
+
/**
|
|
10
|
+
* LogLevel type
|
|
11
|
+
*/
|
|
12
|
+
type LogLevel = 'off' | 'error' | 'debug' | 'verbose';
|
|
13
|
+
/**
|
|
14
|
+
* BasisForProsessing
|
|
15
|
+
*/
|
|
16
|
+
type Basis = 'consent' | 'contract' | 'legal_obligation' | 'legitimate_interests' | 'public_task' | 'vital_interests';
|
|
17
|
+
/**
|
|
18
|
+
* BufferOption
|
|
19
|
+
*/
|
|
20
|
+
type BufferOption = 'single' | 'default' | 'large';
|
|
21
|
+
/**
|
|
22
|
+
* Trigger for MessageNotification event
|
|
23
|
+
*/
|
|
24
|
+
type Trigger = 'push' | 'location' | 'calendar' | 'timeInterval' | 'other';
|
|
25
|
+
/**
|
|
26
|
+
* ScreenSize
|
|
27
|
+
*/
|
|
28
|
+
type ScreenSize = [number, number];
|
|
29
|
+
/**
|
|
30
|
+
* SelfDescribing type
|
|
31
|
+
*/
|
|
32
|
+
type SelfDescribing<T extends Record<keyof T, unknown> = Record<string, unknown>> = {
|
|
33
|
+
/**
|
|
34
|
+
* Schema
|
|
35
|
+
*/
|
|
36
|
+
schema: string;
|
|
37
|
+
/**
|
|
38
|
+
* Data
|
|
39
|
+
*/
|
|
40
|
+
data: T;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* EventContext type
|
|
44
|
+
*/
|
|
45
|
+
type EventContext = SelfDescribing;
|
|
46
|
+
/**
|
|
47
|
+
* NetworkConfiguration
|
|
48
|
+
*/
|
|
49
|
+
interface NetworkConfiguration {
|
|
50
|
+
/**
|
|
51
|
+
* The collector endpoint
|
|
52
|
+
* - if the protocol is not included it defaults to https
|
|
53
|
+
*/
|
|
54
|
+
endpoint: string;
|
|
55
|
+
/**
|
|
56
|
+
* The Http Method to use when sending events to the collector
|
|
57
|
+
* @defaultValue 'post'
|
|
58
|
+
*/
|
|
59
|
+
method?: HttpMethod;
|
|
60
|
+
/**
|
|
61
|
+
* A custom path which will be added to the endpoint URL to specify the
|
|
62
|
+
* complete URL of the collector when paired with the POST method.
|
|
63
|
+
*
|
|
64
|
+
* @defaultValue `com.snowplowanalytics.snowplow/tp2`.
|
|
65
|
+
*/
|
|
66
|
+
customPostPath?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Custom headers for HTTP requests to the Collector.
|
|
69
|
+
*/
|
|
70
|
+
requestHeaders?: Record<string, string>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* TrackerConfiguration
|
|
74
|
+
*/
|
|
75
|
+
interface TrackerConfiguration {
|
|
76
|
+
/**
|
|
77
|
+
* The device platform the tracker runs on.
|
|
78
|
+
* @defaultValue 'mob'
|
|
79
|
+
*/
|
|
80
|
+
devicePlatform?: DevicePlatform;
|
|
81
|
+
/**
|
|
82
|
+
* Whether payload JSON data should be base64 encoded.
|
|
83
|
+
* @defaultValue true
|
|
84
|
+
*/
|
|
85
|
+
base64Encoding?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* The log level of tracker logs.
|
|
88
|
+
* @defaultValue 'off'
|
|
89
|
+
*/
|
|
90
|
+
logLevel?: LogLevel;
|
|
91
|
+
/**
|
|
92
|
+
* Whether application context is attached to tracked events.
|
|
93
|
+
* @defaultValue true
|
|
94
|
+
*/
|
|
95
|
+
applicationContext?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Whether platform context is attached to tracked events.
|
|
98
|
+
* @defaultValue true
|
|
99
|
+
*/
|
|
100
|
+
platformContext?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Whether geo-location context is attached to tracked events.
|
|
103
|
+
* @defaultValue false
|
|
104
|
+
*/
|
|
105
|
+
geoLocationContext?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Whether session context is attached to tracked events.
|
|
108
|
+
* @defaultValue true
|
|
109
|
+
*/
|
|
110
|
+
sessionContext?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Whether to attach a Deep Link entity to the first ScreenView tracked in the tracker after DeepLinkReceived event.
|
|
113
|
+
* @defaultValue true
|
|
114
|
+
*/
|
|
115
|
+
deepLinkContext?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Whether screen context is attached to tracked events.
|
|
118
|
+
* @defaultValue true
|
|
119
|
+
*/
|
|
120
|
+
screenContext?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Whether enable automatic tracking of ScreenView events.
|
|
123
|
+
* @defaultValue true
|
|
124
|
+
*/
|
|
125
|
+
screenViewAutotracking?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Whether enable automatic tracking of background and foreground transitions.
|
|
128
|
+
* @defaultValue false
|
|
129
|
+
*/
|
|
130
|
+
lifecycleAutotracking?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Whether enable automatic tracking of install event.
|
|
133
|
+
* @defaultValue true
|
|
134
|
+
*/
|
|
135
|
+
installAutotracking?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Whether enable crash reporting.
|
|
138
|
+
* @defaultValue true
|
|
139
|
+
*/
|
|
140
|
+
exceptionAutotracking?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Whether enable diagnostic reporting.
|
|
143
|
+
* @defaultValue false
|
|
144
|
+
*/
|
|
145
|
+
diagnosticAutotracking?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Whether to anonymise client-side user identifiers in session and platform context entities
|
|
148
|
+
* @defaultValue false
|
|
149
|
+
*/
|
|
150
|
+
userAnonymisation?: boolean;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* SessionConfiguration
|
|
154
|
+
*/
|
|
155
|
+
interface SessionConfiguration {
|
|
156
|
+
/**
|
|
157
|
+
* The amount of time in seconds before the session id is updated while the app is in the foreground
|
|
158
|
+
* @defaultValue 1800
|
|
159
|
+
*/
|
|
160
|
+
foregroundTimeout: number;
|
|
161
|
+
/**
|
|
162
|
+
* The amount of time in seconds before the session id is updated while the app is in the background
|
|
163
|
+
* @defaultValue 1800
|
|
164
|
+
*/
|
|
165
|
+
backgroundTimeout: number;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* EmitterConfiguration
|
|
169
|
+
*/
|
|
170
|
+
interface EmitterConfiguration {
|
|
171
|
+
/**
|
|
172
|
+
* The buffer option for post requests.
|
|
173
|
+
* @defaultValue 'single'
|
|
174
|
+
*/
|
|
175
|
+
bufferOption?: BufferOption;
|
|
176
|
+
/**
|
|
177
|
+
* Maximum number of events collected from the EventStore to be sent in a request.
|
|
178
|
+
* @defaultValue 150
|
|
179
|
+
*/
|
|
180
|
+
emitRange?: number;
|
|
181
|
+
/**
|
|
182
|
+
*Maximum number of threads working in parallel in the tracker to send requests.
|
|
183
|
+
* @defaultValue 15
|
|
184
|
+
*/
|
|
185
|
+
threadPoolSize?: number;
|
|
186
|
+
/**
|
|
187
|
+
* Maximum amount of bytes allowed to be sent in a payload in a POST request.
|
|
188
|
+
* @defaultValue 40000
|
|
189
|
+
*/
|
|
190
|
+
byteLimitPost?: number;
|
|
191
|
+
/**
|
|
192
|
+
* Maximum amount of bytes allowed to be sent in a payload in a GET request.
|
|
193
|
+
* @defaultValue 40000
|
|
194
|
+
*/
|
|
195
|
+
byteLimitGet?: number;
|
|
196
|
+
/**
|
|
197
|
+
* Whether to anonymise server-side user identifiers including the `network_userid` and `user_ipaddress`
|
|
198
|
+
* @defaultValue false
|
|
199
|
+
*/
|
|
200
|
+
serverAnonymisation?: boolean;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* SubjectConfiguration
|
|
204
|
+
*/
|
|
205
|
+
interface SubjectConfiguration {
|
|
206
|
+
[index: string]: unknown;
|
|
207
|
+
/**
|
|
208
|
+
* user id
|
|
209
|
+
*/
|
|
210
|
+
userId?: string | null;
|
|
211
|
+
/**
|
|
212
|
+
* network user id (UUIDv4)
|
|
213
|
+
*/
|
|
214
|
+
networkUserId?: string | null;
|
|
215
|
+
/**
|
|
216
|
+
* domain user id
|
|
217
|
+
*/
|
|
218
|
+
domainUserId?: string | null;
|
|
219
|
+
/**
|
|
220
|
+
* The custom user-agent. It overrides the user-agent used by default.
|
|
221
|
+
*/
|
|
222
|
+
useragent?: string | null;
|
|
223
|
+
/**
|
|
224
|
+
* IP address
|
|
225
|
+
*/
|
|
226
|
+
ipAddress?: string | null;
|
|
227
|
+
/**
|
|
228
|
+
* The timezone label
|
|
229
|
+
*/
|
|
230
|
+
timezone?: string | null;
|
|
231
|
+
/**
|
|
232
|
+
* The language set in the device
|
|
233
|
+
*/
|
|
234
|
+
language?: string | null;
|
|
235
|
+
/**
|
|
236
|
+
* The screen resolution
|
|
237
|
+
*/
|
|
238
|
+
screenResolution?: ScreenSize | null;
|
|
239
|
+
/**
|
|
240
|
+
* The screen viewport size
|
|
241
|
+
*/
|
|
242
|
+
screenViewport?: ScreenSize | null;
|
|
243
|
+
/**
|
|
244
|
+
* color depth (integer)
|
|
245
|
+
*/
|
|
246
|
+
colorDepth?: number | null;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* GdprConfiguration
|
|
250
|
+
*/
|
|
251
|
+
interface GdprConfiguration {
|
|
252
|
+
/**
|
|
253
|
+
* Basis for processing
|
|
254
|
+
*/
|
|
255
|
+
basisForProcessing: Basis;
|
|
256
|
+
/**
|
|
257
|
+
* ID of a GDPR basis document.
|
|
258
|
+
*/
|
|
259
|
+
documentId: string;
|
|
260
|
+
/**
|
|
261
|
+
* Version of the document.
|
|
262
|
+
*/
|
|
263
|
+
documentVersion: string;
|
|
264
|
+
/**
|
|
265
|
+
* Description of the document.
|
|
266
|
+
*/
|
|
267
|
+
documentDescription: string;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Global Context
|
|
271
|
+
*/
|
|
272
|
+
interface GlobalContext {
|
|
273
|
+
/**
|
|
274
|
+
* tag
|
|
275
|
+
*/
|
|
276
|
+
tag: string;
|
|
277
|
+
/**
|
|
278
|
+
* contexts
|
|
279
|
+
*/
|
|
280
|
+
globalContexts: SelfDescribing[];
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Global Contexts configuration
|
|
284
|
+
*/
|
|
285
|
+
type GCConfiguration = GlobalContext[];
|
|
286
|
+
/**
|
|
287
|
+
* Remote Configuration
|
|
288
|
+
*/
|
|
289
|
+
interface RemoteConfiguration {
|
|
290
|
+
/**
|
|
291
|
+
* The remote config endpoint
|
|
292
|
+
*/
|
|
293
|
+
endpoint: string;
|
|
294
|
+
/**
|
|
295
|
+
* The Http Method to use for fetching the remote config
|
|
296
|
+
* @defaultValue 'post'
|
|
297
|
+
*/
|
|
298
|
+
method?: HttpMethod;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* The TrackerControllerConfiguration
|
|
302
|
+
*/
|
|
303
|
+
interface TrackerControllerConfiguration {
|
|
304
|
+
networkConfig?: NetworkConfiguration;
|
|
305
|
+
trackerConfig?: TrackerConfiguration;
|
|
306
|
+
sessionConfig?: SessionConfiguration;
|
|
307
|
+
emitterConfig?: EmitterConfiguration;
|
|
308
|
+
subjectConfig?: SubjectConfiguration;
|
|
309
|
+
gdprConfig?: GdprConfiguration;
|
|
310
|
+
gcConfig?: GCConfiguration;
|
|
311
|
+
remoteConfig?: RemoteConfiguration;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* ScreenView event properties
|
|
315
|
+
* schema: iglu:com.snowplowanalytics.mobile/screen_view/jsonschema/1-0-0
|
|
316
|
+
*/
|
|
317
|
+
type ScreenViewProps = {
|
|
318
|
+
/**
|
|
319
|
+
* The name of the screen viewed
|
|
320
|
+
*/
|
|
321
|
+
name: string;
|
|
322
|
+
/**
|
|
323
|
+
* The id(UUID) of screen that was viewed
|
|
324
|
+
*/
|
|
325
|
+
id?: string;
|
|
326
|
+
/**
|
|
327
|
+
* The type of screen that was viewed
|
|
328
|
+
*/
|
|
329
|
+
type?: string;
|
|
330
|
+
/**
|
|
331
|
+
* The name of the previous screen that was viewed
|
|
332
|
+
*/
|
|
333
|
+
previousName?: string;
|
|
334
|
+
/**
|
|
335
|
+
* The id(UUID) of the previous screen that was viewed
|
|
336
|
+
*/
|
|
337
|
+
previousId?: string;
|
|
338
|
+
/**
|
|
339
|
+
* The type of the previous screen that was viewed
|
|
340
|
+
*/
|
|
341
|
+
previousType?: string;
|
|
342
|
+
/**
|
|
343
|
+
* The type of transition that led to the screen being viewed
|
|
344
|
+
*/
|
|
345
|
+
transitionType?: string;
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* Structured event properties
|
|
349
|
+
*/
|
|
350
|
+
type StructuredProps = {
|
|
351
|
+
/**
|
|
352
|
+
* The category of the event
|
|
353
|
+
*/
|
|
354
|
+
category: string;
|
|
355
|
+
/**
|
|
356
|
+
* The action the event represents
|
|
357
|
+
*/
|
|
358
|
+
action: string;
|
|
359
|
+
/**
|
|
360
|
+
* The label the action refers to
|
|
361
|
+
*/
|
|
362
|
+
label?: string;
|
|
363
|
+
/**
|
|
364
|
+
* The property associated with the user action
|
|
365
|
+
*/
|
|
366
|
+
property?: string;
|
|
367
|
+
/**
|
|
368
|
+
* The value associated with the user action
|
|
369
|
+
*/
|
|
370
|
+
value?: number;
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* PageView event properties
|
|
374
|
+
*/
|
|
375
|
+
type PageViewProps = {
|
|
376
|
+
/**
|
|
377
|
+
* The page URL
|
|
378
|
+
*/
|
|
379
|
+
pageUrl: string;
|
|
380
|
+
/**
|
|
381
|
+
* The page title
|
|
382
|
+
*/
|
|
383
|
+
pageTitle?: string;
|
|
384
|
+
/**
|
|
385
|
+
* The referrer URL
|
|
386
|
+
*/
|
|
387
|
+
referrer?: string;
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Timing event properties
|
|
391
|
+
*/
|
|
392
|
+
type TimingProps = {
|
|
393
|
+
/**
|
|
394
|
+
* The timing category
|
|
395
|
+
*/
|
|
396
|
+
category: string;
|
|
397
|
+
/**
|
|
398
|
+
* The timing variable
|
|
399
|
+
*/
|
|
400
|
+
variable: string;
|
|
401
|
+
/**
|
|
402
|
+
* The time
|
|
403
|
+
*/
|
|
404
|
+
timing: number;
|
|
405
|
+
/**
|
|
406
|
+
* The timing label
|
|
407
|
+
*/
|
|
408
|
+
label?: string;
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* ConsentDocument properties
|
|
412
|
+
*/
|
|
413
|
+
interface ConsentDocument {
|
|
414
|
+
/**
|
|
415
|
+
* The consent document id
|
|
416
|
+
*/
|
|
417
|
+
documentId: string;
|
|
418
|
+
/**
|
|
419
|
+
* The consent document version
|
|
420
|
+
*/
|
|
421
|
+
version: string;
|
|
422
|
+
/**
|
|
423
|
+
* The consent document name
|
|
424
|
+
*/
|
|
425
|
+
name?: string;
|
|
426
|
+
/**
|
|
427
|
+
* The consent document description
|
|
428
|
+
*/
|
|
429
|
+
documentDescription?: string;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* ConsentGranted event properties
|
|
433
|
+
*/
|
|
434
|
+
interface ConsentGrantedProps extends ConsentDocument {
|
|
435
|
+
/**
|
|
436
|
+
* The expiry (date-time string, e.g.: '2022-01-01T00:00:00Z')
|
|
437
|
+
*/
|
|
438
|
+
expiry: string;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* ConsentWithdrawn event properties
|
|
442
|
+
*/
|
|
443
|
+
interface ConsentWithdrawnProps extends ConsentDocument {
|
|
444
|
+
/**
|
|
445
|
+
* Whether user opts out of all data collection
|
|
446
|
+
*/
|
|
447
|
+
all: boolean;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* EcommerceItem
|
|
451
|
+
*/
|
|
452
|
+
type EcommerceItem = {
|
|
453
|
+
sku: string;
|
|
454
|
+
price: number;
|
|
455
|
+
quantity: number;
|
|
456
|
+
name?: string;
|
|
457
|
+
category?: string;
|
|
458
|
+
currency?: string;
|
|
459
|
+
};
|
|
460
|
+
/**
|
|
461
|
+
* EcommerceTransaction event properties
|
|
462
|
+
*/
|
|
463
|
+
type EcommerceTransactionProps = {
|
|
464
|
+
orderId: string;
|
|
465
|
+
totalValue: number;
|
|
466
|
+
items: EcommerceItem[];
|
|
467
|
+
affiliation?: string;
|
|
468
|
+
taxValue?: number;
|
|
469
|
+
shipping?: number;
|
|
470
|
+
city?: string;
|
|
471
|
+
state?: string;
|
|
472
|
+
country?: string;
|
|
473
|
+
currency?: string;
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* DeepLinkReceived event properties
|
|
477
|
+
* schema: iglu:com.snowplowanalytics.mobile/deep_link_received/jsonschema/1-0-0
|
|
478
|
+
*/
|
|
479
|
+
type DeepLinkReceivedProps = {
|
|
480
|
+
/**
|
|
481
|
+
* URL in the received deep-link.
|
|
482
|
+
*/
|
|
483
|
+
url: string;
|
|
484
|
+
/**
|
|
485
|
+
* Referrer URL, source of this deep-link.
|
|
486
|
+
*/
|
|
487
|
+
referrer?: string;
|
|
488
|
+
};
|
|
489
|
+
/**
|
|
490
|
+
* Attachment object that identify an attachment in the MessageNotification.
|
|
491
|
+
*/
|
|
492
|
+
type MessageNotificationAttachmentProps = {
|
|
493
|
+
identifier: string;
|
|
494
|
+
type: string;
|
|
495
|
+
url: string;
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* MessageNotification event properties
|
|
499
|
+
* schema: iglu:com.snowplowanalytics.mobile/message_notification/jsonschema/1-0-0
|
|
500
|
+
*/
|
|
501
|
+
type MessageNotificationProps = {
|
|
502
|
+
/**
|
|
503
|
+
* The action associated with the notification.
|
|
504
|
+
*/
|
|
505
|
+
action?: string;
|
|
506
|
+
attachments?: MessageNotificationAttachmentProps[];
|
|
507
|
+
/**
|
|
508
|
+
* The notification's body.
|
|
509
|
+
*/
|
|
510
|
+
body: string;
|
|
511
|
+
bodyLocArgs?: string[];
|
|
512
|
+
/**
|
|
513
|
+
* The key to the body string in the app's string resources to use to localize the body text to the user's current localization.
|
|
514
|
+
*/
|
|
515
|
+
bodyLocKey?: string;
|
|
516
|
+
/**
|
|
517
|
+
* The category associated to the notification.
|
|
518
|
+
*/
|
|
519
|
+
category?: string;
|
|
520
|
+
/**
|
|
521
|
+
* The application is notified of the delivery of the notification if it's in the foreground or background, the app will be woken up (iOS only).
|
|
522
|
+
*/
|
|
523
|
+
contentAvailable?: boolean;
|
|
524
|
+
/**
|
|
525
|
+
* The group which this notification is part of.
|
|
526
|
+
*/
|
|
527
|
+
group?: string;
|
|
528
|
+
/**
|
|
529
|
+
* The icon associated to the notification (Android only).
|
|
530
|
+
*/
|
|
531
|
+
icon?: string;
|
|
532
|
+
/**
|
|
533
|
+
* The number of items this notification represent.
|
|
534
|
+
*/
|
|
535
|
+
notificationCount?: number;
|
|
536
|
+
/**
|
|
537
|
+
* The time when the event of the notification occurred.
|
|
538
|
+
*/
|
|
539
|
+
notificationTimestamp?: string;
|
|
540
|
+
/**
|
|
541
|
+
* The sound played when the device receives the notification.
|
|
542
|
+
*/
|
|
543
|
+
sound?: string;
|
|
544
|
+
/**
|
|
545
|
+
* The notification's subtitle. (iOS only)
|
|
546
|
+
*/
|
|
547
|
+
subtitle?: string;
|
|
548
|
+
/**
|
|
549
|
+
* An identifier similar to 'group' but usable for different purposes (Android only).
|
|
550
|
+
*/
|
|
551
|
+
tag?: string;
|
|
552
|
+
/**
|
|
553
|
+
* An identifier similar to 'group' but usable for different purposes (iOS only).
|
|
554
|
+
*/
|
|
555
|
+
threadIdentifier?: string;
|
|
556
|
+
/**
|
|
557
|
+
* The notification's title.
|
|
558
|
+
*/
|
|
559
|
+
title: string;
|
|
560
|
+
/**
|
|
561
|
+
* Variable string values to be used in place of the format specifiers in titleLocArgs to use to localize the title text to the user's current localization.
|
|
562
|
+
*/
|
|
563
|
+
titleLocArgs?: string[];
|
|
564
|
+
/**
|
|
565
|
+
* The key to the title string in the app's string resources to use to localize the title text to the user's current localization.
|
|
566
|
+
*/
|
|
567
|
+
titleLocKey?: string;
|
|
568
|
+
/**
|
|
569
|
+
* The trigger that raised the notification message. Must be one of: push, location, calendar, timeInterval, other
|
|
570
|
+
*/
|
|
571
|
+
trigger: Trigger;
|
|
572
|
+
};
|
|
573
|
+
/**
|
|
574
|
+
* The ReactNativeTracker type
|
|
575
|
+
*/
|
|
576
|
+
type ReactNativeTracker = {
|
|
577
|
+
/**
|
|
578
|
+
* Tracks a self-descibing event
|
|
579
|
+
*
|
|
580
|
+
* @param argmap - The self-describing event properties
|
|
581
|
+
* @param contexts - The array of event contexts
|
|
582
|
+
* @typeParam TData - The type of the data object within the SelfDescribing object
|
|
583
|
+
*/
|
|
584
|
+
readonly trackSelfDescribingEvent: <TData extends Record<keyof TData, unknown> = Record<string, unknown>>(argmap: SelfDescribing<TData>, contexts?: EventContext[]) => Promise<void>;
|
|
585
|
+
/**
|
|
586
|
+
* Tracks a screen-view event
|
|
587
|
+
*
|
|
588
|
+
* @param argmap - The screen-view event's properties
|
|
589
|
+
* @param contexts - The array of event contexts
|
|
590
|
+
*/
|
|
591
|
+
readonly trackScreenViewEvent: (argmap: ScreenViewProps, contexts?: EventContext[]) => Promise<void>;
|
|
592
|
+
/**
|
|
593
|
+
* Tracks a structured event
|
|
594
|
+
*
|
|
595
|
+
* @param argmap - The structured event properties
|
|
596
|
+
* @param contexts - The array of event contexts
|
|
597
|
+
*/
|
|
598
|
+
readonly trackStructuredEvent: (argmap: StructuredProps, contexts?: EventContext[]) => Promise<void>;
|
|
599
|
+
/**
|
|
600
|
+
* Tracks a page-view event
|
|
601
|
+
*
|
|
602
|
+
* @param argmap - The page-view event properties
|
|
603
|
+
* @param contexts - The array of event contexts
|
|
604
|
+
*/
|
|
605
|
+
readonly trackPageView: (argmap: PageViewProps, contexts?: EventContext[]) => Promise<void>;
|
|
606
|
+
/**
|
|
607
|
+
* Tracks a timing event
|
|
608
|
+
*
|
|
609
|
+
* @param argmap - The timing event properties
|
|
610
|
+
* @param contexts - The array of event contexts
|
|
611
|
+
*/
|
|
612
|
+
readonly trackTimingEvent: (argmap: TimingProps, contexts?: EventContext[]) => Promise<void>;
|
|
613
|
+
/**
|
|
614
|
+
* Tracks a consent-granted event
|
|
615
|
+
*
|
|
616
|
+
* @param argmap - The consent-granted event properties
|
|
617
|
+
* @param contexts - The array of event contexts
|
|
618
|
+
*/
|
|
619
|
+
readonly trackConsentGrantedEvent: (argmap: ConsentGrantedProps, contexts?: EventContext[]) => Promise<void>;
|
|
620
|
+
/**
|
|
621
|
+
* Tracks a consent-withdrawn event
|
|
622
|
+
*
|
|
623
|
+
* @param argmap - The consent-withdrawn event properties
|
|
624
|
+
* @param contexts - The array of event contexts
|
|
625
|
+
*/
|
|
626
|
+
readonly trackConsentWithdrawnEvent: (argmap: ConsentWithdrawnProps, contexts?: EventContext[]) => Promise<void>;
|
|
627
|
+
/**
|
|
628
|
+
* Tracks an ecommerce-transaction event
|
|
629
|
+
*
|
|
630
|
+
* @param argmap - The ecommerce-transaction event properties
|
|
631
|
+
* @param contexts - The array of event contexts
|
|
632
|
+
*/
|
|
633
|
+
readonly trackEcommerceTransactionEvent: (argmap: EcommerceTransactionProps, contexts?: EventContext[]) => Promise<void>;
|
|
634
|
+
/**
|
|
635
|
+
* Tracks a deep link received event
|
|
636
|
+
*
|
|
637
|
+
* @param argmap - The deep link received event properties
|
|
638
|
+
* @param contexts - The array of event contexts
|
|
639
|
+
*/
|
|
640
|
+
readonly trackDeepLinkReceivedEvent: (argmap: DeepLinkReceivedProps, contexts?: EventContext[]) => Promise<void>;
|
|
641
|
+
/**
|
|
642
|
+
* Tracks a message notification event
|
|
643
|
+
*
|
|
644
|
+
* @param argmap - The message notification event properties
|
|
645
|
+
* @param contexts - The array of event contexts
|
|
646
|
+
*/
|
|
647
|
+
readonly trackMessageNotificationEvent: (argmap: MessageNotificationProps, contexts?: EventContext[]) => Promise<void>;
|
|
648
|
+
/**
|
|
649
|
+
* Tracks a Custom Event
|
|
650
|
+
*
|
|
651
|
+
* @param eventName {string} - the custom event name
|
|
652
|
+
* @param eventData {any} - the event data
|
|
653
|
+
* @param contexts {Array}- the event contexts
|
|
654
|
+
* @returns {Promise}
|
|
655
|
+
*/
|
|
656
|
+
readonly trackCustomEvent: (eventName: string, eventData: any, contexts?: EventContext[]) => Promise<void>;
|
|
657
|
+
/**
|
|
658
|
+
* Sets custom tags
|
|
659
|
+
*
|
|
660
|
+
* @param tags {any} - the custom tags
|
|
661
|
+
* @param contexts {Array}- the event contexts
|
|
662
|
+
* @returns {Promise}
|
|
663
|
+
*/
|
|
664
|
+
readonly setCustomTags: (tags: any, contexts?: EventContext[]) => Promise<void>;
|
|
665
|
+
/**
|
|
666
|
+
* Sets custom tags with category
|
|
667
|
+
*
|
|
668
|
+
* @param category {string} - category
|
|
669
|
+
* @param tags {any} - the custom tags
|
|
670
|
+
* @param contexts {Array}- the event contexts
|
|
671
|
+
* @returns {Promise}
|
|
672
|
+
*/
|
|
673
|
+
readonly setCustomTagsWithCategory: (category: string, tags: any, contexts?: EventContext[]) => Promise<void>;
|
|
674
|
+
/**
|
|
675
|
+
* Clears few of the Custom Tags which are set previously
|
|
676
|
+
*
|
|
677
|
+
* @param tagKeys {string []} - the custom tag keys to be deleted
|
|
678
|
+
* @param contexts {Array}- the event contexts
|
|
679
|
+
* @returns {Promise}
|
|
680
|
+
*/
|
|
681
|
+
readonly clearCustomTags: (tagKeys: string[], contexts?: EventContext[]) => Promise<void>;
|
|
682
|
+
/**
|
|
683
|
+
* Clears all the previously set Custom Tags
|
|
684
|
+
*
|
|
685
|
+
* @param contexts {Array}- the event contexts
|
|
686
|
+
* @returns {Promise}
|
|
687
|
+
*/
|
|
688
|
+
readonly clearAllCustomTags: (contexts?: EventContext[]) => Promise<void>;
|
|
689
|
+
/**
|
|
690
|
+
* Removes global contexts
|
|
691
|
+
*
|
|
692
|
+
* @param tag - The tag of the global contexts to remove
|
|
693
|
+
*/
|
|
694
|
+
readonly removeGlobalContexts: (tag: string) => Promise<void>;
|
|
695
|
+
/**
|
|
696
|
+
* Adds global contexts
|
|
697
|
+
*
|
|
698
|
+
* @param gc - The global context to add
|
|
699
|
+
*/
|
|
700
|
+
readonly addGlobalContexts: (gc: GlobalContext) => Promise<void>;
|
|
701
|
+
/**
|
|
702
|
+
* Sets the userId of the tracker subject
|
|
703
|
+
*
|
|
704
|
+
* @param newUid - The new userId
|
|
705
|
+
*/
|
|
706
|
+
readonly setUserId: (newUid: string | null) => Promise<void>;
|
|
707
|
+
/**
|
|
708
|
+
* Sets the networkUserId of the tracker subject
|
|
709
|
+
*
|
|
710
|
+
* @param newNuid - The new networkUserId
|
|
711
|
+
*/
|
|
712
|
+
readonly setNetworkUserId: (newNuid: string | null) => Promise<void>;
|
|
713
|
+
/**
|
|
714
|
+
* Sets the domainUserId of the tracker subject
|
|
715
|
+
*
|
|
716
|
+
* @param newDuid - The new domainUserId
|
|
717
|
+
*/
|
|
718
|
+
readonly setDomainUserId: (newDuid: string | null) => Promise<void>;
|
|
719
|
+
/**
|
|
720
|
+
* Sets the ipAddress of the tracker subject
|
|
721
|
+
*
|
|
722
|
+
* @param newIp - The new ipAddress
|
|
723
|
+
*/
|
|
724
|
+
readonly setIpAddress: (newIp: string | null) => Promise<void>;
|
|
725
|
+
/**
|
|
726
|
+
* Sets the useragent of the tracker subject
|
|
727
|
+
*
|
|
728
|
+
* @param newUagent - The new useragent
|
|
729
|
+
*/
|
|
730
|
+
readonly setUseragent: (newUagent: string | null) => Promise<void>;
|
|
731
|
+
/**
|
|
732
|
+
* Sets the timezone of the tracker subject
|
|
733
|
+
*
|
|
734
|
+
* @param newTz - The new timezone
|
|
735
|
+
*/
|
|
736
|
+
readonly setTimezone: (newTz: string | null) => Promise<void>;
|
|
737
|
+
/**
|
|
738
|
+
* Sets the language of the tracker subject
|
|
739
|
+
*
|
|
740
|
+
* @param newLang - The new language
|
|
741
|
+
*/
|
|
742
|
+
readonly setLanguage: (newLang: string | null) => Promise<void>;
|
|
743
|
+
/**
|
|
744
|
+
* Sets the screenResolution of the tracker subject
|
|
745
|
+
*
|
|
746
|
+
* @param newRes - The new screenResolution
|
|
747
|
+
*/
|
|
748
|
+
readonly setScreenResolution: (newRes: ScreenSize | null) => Promise<void>;
|
|
749
|
+
/**
|
|
750
|
+
* Sets the screenViewport of the tracker subject
|
|
751
|
+
*
|
|
752
|
+
* @param newView - The new screenViewport
|
|
753
|
+
*/
|
|
754
|
+
readonly setScreenViewport: (newView: ScreenSize | null) => Promise<void>;
|
|
755
|
+
/**
|
|
756
|
+
* Sets the colorDepth of the tracker subject
|
|
757
|
+
*
|
|
758
|
+
* @param newColorD - The new colorDepth
|
|
759
|
+
*/
|
|
760
|
+
readonly setColorDepth: (newLang: number | null) => Promise<void>;
|
|
761
|
+
/**
|
|
762
|
+
* Sets subject data
|
|
763
|
+
*
|
|
764
|
+
* @param config - The new subject data
|
|
765
|
+
*/
|
|
766
|
+
readonly setSubjectData: (config: SubjectConfiguration) => Promise<void>;
|
|
767
|
+
/**
|
|
768
|
+
* Gets the dentifier for the user of the session
|
|
769
|
+
*
|
|
770
|
+
* @returns {Promise<string | undefined>}
|
|
771
|
+
*/
|
|
772
|
+
readonly getSessionUserId: () => Promise<string | undefined>;
|
|
773
|
+
/**
|
|
774
|
+
* Gets the identifier for the session
|
|
775
|
+
*
|
|
776
|
+
* @returns {Promise<string | undefined>}
|
|
777
|
+
*/
|
|
778
|
+
readonly getSessionId: () => Promise<string | undefined>;
|
|
779
|
+
/**
|
|
780
|
+
* Gets the index of the current session for this user
|
|
781
|
+
*
|
|
782
|
+
* @returns {Promise<number | undefined>}
|
|
783
|
+
*/
|
|
784
|
+
readonly getSessionIndex: () => Promise<number | undefined>;
|
|
785
|
+
/**
|
|
786
|
+
* Gets whether the app is currently in background state
|
|
787
|
+
*
|
|
788
|
+
* @returns {Promise<boolean | undefined>}
|
|
789
|
+
*/
|
|
790
|
+
readonly getIsInBackground: () => Promise<boolean | undefined>;
|
|
791
|
+
/**
|
|
792
|
+
* Gets the number of background transitions in the current session
|
|
793
|
+
*
|
|
794
|
+
* @returns {Promise<number | undefined>}
|
|
795
|
+
*/
|
|
796
|
+
readonly getBackgroundIndex: () => Promise<number | undefined>;
|
|
797
|
+
/**
|
|
798
|
+
* Gets the number of foreground transitions in the current session.
|
|
799
|
+
*
|
|
800
|
+
* @returns {Promise<number | undefined>}
|
|
801
|
+
*/
|
|
802
|
+
readonly getForegroundIndex: () => Promise<number | undefined>;
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Enables tracking events from apps rendered in react-native-webview components.
|
|
807
|
+
* The apps need to use the Conviva WebView tracker to track the events.
|
|
808
|
+
*
|
|
809
|
+
* To subscribe for the events, set the `onMessage` attribute:
|
|
810
|
+
* <WebView onMessage={getWebViewCallback()} ... />
|
|
811
|
+
*
|
|
812
|
+
* @returns Callback to subscribe for events from Web views tracked using the Conviva WebView tracker.
|
|
813
|
+
*/
|
|
814
|
+
declare function getWebViewCallback(): (message: {
|
|
815
|
+
nativeEvent: {
|
|
816
|
+
data: string;
|
|
817
|
+
};
|
|
818
|
+
}) => void;
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* Creates a React Native Tracker object
|
|
822
|
+
*
|
|
823
|
+
* @param networkConfig {Object} - The network configuration
|
|
824
|
+
* @param control {Array} - The tracker controller configuration
|
|
825
|
+
* @returns The tracker object
|
|
826
|
+
*/
|
|
827
|
+
declare function createTracker(customerKey: string, appName: string, controllerConfig?: TrackerControllerConfiguration): ReactNativeTracker;
|
|
828
|
+
/**
|
|
829
|
+
* Removes a tracker given its namespace
|
|
830
|
+
*
|
|
831
|
+
* @param trackerNamespace {string}
|
|
832
|
+
* @returns - A boolean promise
|
|
833
|
+
*/
|
|
834
|
+
declare function removeTracker(trackerNamespace: string): Promise<boolean>;
|
|
835
|
+
/**
|
|
836
|
+
* Removes all trackers
|
|
837
|
+
*
|
|
838
|
+
* @returns - A boolean promise
|
|
839
|
+
*/
|
|
840
|
+
declare function removeAllTrackers(): Promise<boolean>;
|
|
841
|
+
|
|
842
|
+
export { Basis, BufferOption, ConsentDocument, ConsentGrantedProps, ConsentWithdrawnProps, DeepLinkReceivedProps, DevicePlatform, EcommerceItem, EcommerceTransactionProps, EmitterConfiguration, EventContext, GCConfiguration, GdprConfiguration, GlobalContext, HttpMethod, LogLevel, MessageNotificationProps, NetworkConfiguration, PageViewProps, ReactNativeTracker, ScreenSize, ScreenViewProps, SelfDescribing, SessionConfiguration, StructuredProps, SubjectConfiguration, TimingProps, TrackerConfiguration, TrackerControllerConfiguration, Trigger, createTracker, getWebViewCallback, removeAllTrackers, removeTracker };
|