affise-attribution-lib 1.1.5 → 1.1.6
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/README.md +668 -648
- package/affise-attribution-native.podspec +38 -37
- package/ios/AffiseAttributionNative.m +102 -93
- package/ios/AffiseAttributionNative.swift +238 -161
- package/lib/commonjs/index.js +82 -47
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +82 -47
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +13 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +163 -163
- package/src/index.tsx +237 -199
package/README.md
CHANGED
|
@@ -1,648 +1,668 @@
|
|
|
1
|
-
# Affise Attribution React Native library
|
|
2
|
-
|
|
3
|
-
- [Affise Attribution React Native library](#affise-attribution-react-native-library)
|
|
4
|
-
- [Description](#description)
|
|
5
|
-
- [Quick start](#quick-start)
|
|
6
|
-
- [Integration](#integration)
|
|
7
|
-
- [Integrate npm package](#integrate-npm-package)
|
|
8
|
-
- [Initialize](#initialize)
|
|
9
|
-
- [Requirements](#requirements)
|
|
10
|
-
- [Android](#android)
|
|
11
|
-
- [Features](#features)
|
|
12
|
-
- [Device identifiers collection](#device-identifiers-collection)
|
|
13
|
-
- [Events tracking](#events-tracking)
|
|
14
|
-
- [Custom events tracking](#custom-events-tracking)
|
|
15
|
-
- [Predefined event parameters](#predefined-event-parameters)
|
|
16
|
-
- [Events buffering](#events-buffering)
|
|
17
|
-
- [Advertising Identifier (google) tracking](#advertising-identifier-google-tracking)
|
|
18
|
-
- [Open Advertising Identifier (huawei) tracking](#open-advertising-identifier-huawei-tracking)
|
|
19
|
-
- [Install referrer tracking](#install-referrer-tracking)
|
|
20
|
-
- [Push token tracking](#push-token-tracking)
|
|
21
|
-
- [Reinstall Uninstall tracking](#reinstall-uninstall-tracking)
|
|
22
|
-
- [APK preinstall tracking](#apk-preinstall-tracking)
|
|
23
|
-
- [Deeplinks](#deeplinks)
|
|
24
|
-
- [Android](#android-1)
|
|
25
|
-
- [iOS](#ios)
|
|
26
|
-
- [Offline mode](#offline-mode)
|
|
27
|
-
- [Disable tracking](#disable-tracking)
|
|
28
|
-
- [Disable background tracking](#disable-background-tracking)
|
|
29
|
-
- [GDPR right to be forgotten](#gdpr-right-to-be-forgotten)
|
|
30
|
-
- [Platform specific](#platform-specific)
|
|
31
|
-
- [Get referrer](#get-referrer)
|
|
32
|
-
- [Get referrer value](#get-referrer-value)
|
|
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
|
-
implementation 'com.affise:module-
|
|
73
|
-
implementation 'com.affise:module-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
null, //Change to your
|
|
97
|
-
null, //Change to your
|
|
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
|
-
- `
|
|
357
|
-
- `
|
|
358
|
-
- `
|
|
359
|
-
- `
|
|
360
|
-
- `
|
|
361
|
-
- `
|
|
362
|
-
- `
|
|
363
|
-
- `
|
|
364
|
-
- `
|
|
365
|
-
- `
|
|
366
|
-
- `
|
|
367
|
-
- `
|
|
368
|
-
- `
|
|
369
|
-
- `
|
|
370
|
-
- `
|
|
371
|
-
- `
|
|
372
|
-
- `
|
|
373
|
-
- `
|
|
374
|
-
- `
|
|
375
|
-
- `
|
|
376
|
-
- `
|
|
377
|
-
- `
|
|
378
|
-
- `
|
|
379
|
-
- `
|
|
380
|
-
- `
|
|
381
|
-
- `
|
|
382
|
-
- `
|
|
383
|
-
- `
|
|
384
|
-
- `
|
|
385
|
-
- `
|
|
386
|
-
- `
|
|
387
|
-
- `
|
|
388
|
-
- `
|
|
389
|
-
- `
|
|
390
|
-
- `
|
|
391
|
-
- `
|
|
392
|
-
- `
|
|
393
|
-
- `
|
|
394
|
-
- `
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
import
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
Affise.
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
<category android:name="android.intent.category.
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
android:
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
<
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
<
|
|
499
|
-
<
|
|
500
|
-
<
|
|
501
|
-
<
|
|
502
|
-
<
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
</
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
Affise.
|
|
516
|
-
Affise.setOfflineModeEnabled(
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
Affise.
|
|
534
|
-
Affise.setTrackingEnabled(
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
Affise.
|
|
556
|
-
Affise.setBackgroundTrackingEnabled(
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
Affise.
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
Affise.
|
|
587
|
-
Affise.
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
- `
|
|
621
|
-
- `
|
|
622
|
-
- `
|
|
623
|
-
- `
|
|
624
|
-
- `
|
|
625
|
-
- `
|
|
626
|
-
- `
|
|
627
|
-
- `
|
|
628
|
-
- `
|
|
629
|
-
- `
|
|
630
|
-
- `
|
|
631
|
-
- `
|
|
632
|
-
- `
|
|
633
|
-
- `
|
|
634
|
-
- `
|
|
635
|
-
- `
|
|
636
|
-
- `
|
|
637
|
-
- `
|
|
638
|
-
- `
|
|
639
|
-
- `
|
|
640
|
-
- `
|
|
641
|
-
- `
|
|
642
|
-
- `
|
|
643
|
-
- `
|
|
644
|
-
- `
|
|
645
|
-
- `
|
|
646
|
-
- `
|
|
647
|
-
- `
|
|
648
|
-
- `
|
|
1
|
+
# Affise Attribution React Native library
|
|
2
|
+
|
|
3
|
+
- [Affise Attribution React Native library](#affise-attribution-react-native-library)
|
|
4
|
+
- [Description](#description)
|
|
5
|
+
- [Quick start](#quick-start)
|
|
6
|
+
- [Integration](#integration)
|
|
7
|
+
- [Integrate npm package](#integrate-npm-package)
|
|
8
|
+
- [Initialize](#initialize)
|
|
9
|
+
- [Requirements](#requirements)
|
|
10
|
+
- [Android](#android)
|
|
11
|
+
- [Features](#features)
|
|
12
|
+
- [Device identifiers collection](#device-identifiers-collection)
|
|
13
|
+
- [Events tracking](#events-tracking)
|
|
14
|
+
- [Custom events tracking](#custom-events-tracking)
|
|
15
|
+
- [Predefined event parameters](#predefined-event-parameters)
|
|
16
|
+
- [Events buffering](#events-buffering)
|
|
17
|
+
- [Advertising Identifier (google) tracking](#advertising-identifier-google-tracking)
|
|
18
|
+
- [Open Advertising Identifier (huawei) tracking](#open-advertising-identifier-huawei-tracking)
|
|
19
|
+
- [Install referrer tracking](#install-referrer-tracking)
|
|
20
|
+
- [Push token tracking](#push-token-tracking)
|
|
21
|
+
- [Reinstall Uninstall tracking](#reinstall-uninstall-tracking)
|
|
22
|
+
- [APK preinstall tracking](#apk-preinstall-tracking)
|
|
23
|
+
- [Deeplinks](#deeplinks)
|
|
24
|
+
- [Android](#android-1)
|
|
25
|
+
- [iOS](#ios)
|
|
26
|
+
- [Offline mode](#offline-mode)
|
|
27
|
+
- [Disable tracking](#disable-tracking)
|
|
28
|
+
- [Disable background tracking](#disable-background-tracking)
|
|
29
|
+
- [GDPR right to be forgotten](#gdpr-right-to-be-forgotten)
|
|
30
|
+
- [Platform specific](#platform-specific)
|
|
31
|
+
- [Get referrer](#get-referrer)
|
|
32
|
+
- [Get referrer value](#get-referrer-value)
|
|
33
|
+
- [SKAd](#skad)
|
|
34
|
+
|
|
35
|
+
# Description
|
|
36
|
+
|
|
37
|
+
Affise SDK is a software you can use to collect app usage statistics, device identifiers, deeplink usage, track install
|
|
38
|
+
referrer.
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
## Integration
|
|
43
|
+
|
|
44
|
+
### Integrate npm package
|
|
45
|
+
|
|
46
|
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
|
47
|
+
[npm registry](https://www.npmjs.com/).
|
|
48
|
+
|
|
49
|
+
Installation using npm
|
|
50
|
+
|
|
51
|
+
```console
|
|
52
|
+
npm install affise-attribution-lib
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Installation using yarn
|
|
56
|
+
|
|
57
|
+
```console
|
|
58
|
+
yarn add affise-attribution-lib
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Add platform modules
|
|
62
|
+
|
|
63
|
+
##### Android
|
|
64
|
+
|
|
65
|
+
Add modules to android project
|
|
66
|
+
|
|
67
|
+
Example `example/android/app/build.gradle`
|
|
68
|
+
|
|
69
|
+
```gradle
|
|
70
|
+
dependencies {
|
|
71
|
+
// Affise modules
|
|
72
|
+
implementation 'com.affise:module-advertising:1.5.4'
|
|
73
|
+
implementation 'com.affise:module-network:1.5.4'
|
|
74
|
+
implementation 'com.affise:module-phone:1.5.4'
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Initialize
|
|
79
|
+
|
|
80
|
+
After dependency is added, and project is sync with `npm install` and initialize.
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import {
|
|
84
|
+
Affise,
|
|
85
|
+
AffiseInitProperties
|
|
86
|
+
} from 'affise-attribution-lib';
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
export default function App() {
|
|
90
|
+
|
|
91
|
+
React.useEffect(() => {
|
|
92
|
+
Affise.init(
|
|
93
|
+
new AffiseInitProperties(
|
|
94
|
+
'Your appId', //Change to your app id
|
|
95
|
+
true, //Add your custom rule to determine if this is a production build
|
|
96
|
+
null, //Change to your partParamName
|
|
97
|
+
null, //Change to your partParamNameToken
|
|
98
|
+
null, //Change to your appToken
|
|
99
|
+
'Your secretId' //Change to your secretId
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<SafeAreaView>
|
|
106
|
+
</SafeAreaView>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Requirements
|
|
113
|
+
|
|
114
|
+
#### Android
|
|
115
|
+
|
|
116
|
+
Minimal Android SDK version is 21
|
|
117
|
+
|
|
118
|
+
For a minimal working functionality your app needs to declare internet permission:
|
|
119
|
+
|
|
120
|
+
```xml
|
|
121
|
+
<manifest>
|
|
122
|
+
<uses-permission android:name="android.permission.INTERNET"/>
|
|
123
|
+
</manifest>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
OAID certificate in your project (Optional)
|
|
127
|
+
`example/android/app/src/main/assets/oaid.cert.pem`
|
|
128
|
+
|
|
129
|
+
# Features
|
|
130
|
+
|
|
131
|
+
### Device identifiers collection
|
|
132
|
+
|
|
133
|
+
To match users with events and data library is sending, these identifiers are collected:
|
|
134
|
+
|
|
135
|
+
- `AFFISE_APP_ID`
|
|
136
|
+
- `AFFISE_PKG_APP_NAME`
|
|
137
|
+
- `AFFISE_APP_NAME_DASHBOARD`
|
|
138
|
+
- `APP_VERSION`
|
|
139
|
+
- `APP_VERSION_RAW`
|
|
140
|
+
- `STORE`
|
|
141
|
+
- `TRACKER_TOKEN`
|
|
142
|
+
- `TRACKER_NAME`
|
|
143
|
+
- `FIRST_TRACKER_TOKEN`
|
|
144
|
+
- `FIRST_TRACKER_NAME`
|
|
145
|
+
- `LAST_TRACKER_TOKEN`
|
|
146
|
+
- `LAST_TRACKER_NAME`
|
|
147
|
+
- `OUTDATED_TRACKER_TOKEN`
|
|
148
|
+
- `INSTALLED_TIME`
|
|
149
|
+
- `FIRST_OPEN_TIME`
|
|
150
|
+
- `INSTALLED_HOUR`
|
|
151
|
+
- `FIRST_OPEN_HOUR`
|
|
152
|
+
- `INSTALL_BEGIN_TIME`
|
|
153
|
+
- `INSTALL_FINISH_TIME`
|
|
154
|
+
- `REFERRAL_TIME`
|
|
155
|
+
- `CREATED_TIME`
|
|
156
|
+
- `CREATED_TIME_MILLI`
|
|
157
|
+
- `CREATED_TIME_HOUR`
|
|
158
|
+
- `UNINSTALL_TIME`
|
|
159
|
+
- `REINSTALL_TIME`
|
|
160
|
+
- `LAST_SESSION_TIME`
|
|
161
|
+
- `CONNECTION_TYPE`
|
|
162
|
+
- `CPU_TYPE`
|
|
163
|
+
- `HARDWARE_NAME`
|
|
164
|
+
- `NETWORK_TYPE`
|
|
165
|
+
- `DEVICE_MANUFACTURER`
|
|
166
|
+
- `PROXY_IP_ADDRESS`
|
|
167
|
+
- `DEEPLINK_CLICK`
|
|
168
|
+
- `DEVICE_ATLAS_ID`
|
|
169
|
+
- `AFFISE_DEVICE_ID`
|
|
170
|
+
- `AFFISE_ALT_DEVICE_ID`
|
|
171
|
+
- `ADID`
|
|
172
|
+
- `ANDROID_ID`
|
|
173
|
+
- `ANDROID_ID_MD5`
|
|
174
|
+
- `MAC_SHA1`
|
|
175
|
+
- `MAC_MD5`
|
|
176
|
+
- `GAID_ADID`
|
|
177
|
+
- `GAID_ADID_MD5`
|
|
178
|
+
- `OAID`
|
|
179
|
+
- `OAID_MD5`
|
|
180
|
+
- `REFTOKEN`
|
|
181
|
+
- `REFTOKENS`
|
|
182
|
+
- `REFERRER`
|
|
183
|
+
- `USER_AGENT`
|
|
184
|
+
- `MCCODE`
|
|
185
|
+
- `MNCODE`
|
|
186
|
+
- `ISP`
|
|
187
|
+
- `REGION`
|
|
188
|
+
- `COUNTRY`
|
|
189
|
+
- `LANGUAGE`
|
|
190
|
+
- `DEVICE_NAME`
|
|
191
|
+
- `DEVICE_TYPE`
|
|
192
|
+
- `OS_NAME`
|
|
193
|
+
- `PLATFORM`
|
|
194
|
+
- `API_LEVEL_OS`
|
|
195
|
+
- `AFFISE_SDK_VERSION`
|
|
196
|
+
- `OS_VERSION`
|
|
197
|
+
- `RANDOM_USER_ID`
|
|
198
|
+
- `AFFISE_SDK_POS`
|
|
199
|
+
- `TIMEZONE_DEV`
|
|
200
|
+
- `LAST_TIME_SESSION`
|
|
201
|
+
- `TIME_SESSION`
|
|
202
|
+
- `AFFISE_SESSION_COUNT`
|
|
203
|
+
- `LIFETIME_SESSION_COUNT`
|
|
204
|
+
- `AFFISE_DEEPLINK`
|
|
205
|
+
- `AFFISE_PART_PARAM_NAME`
|
|
206
|
+
- `AFFISE_PART_PARAM_NAME_TOKEN`
|
|
207
|
+
- `AFFISE_APP_TOKEN`
|
|
208
|
+
- `LABEL`
|
|
209
|
+
- `AFFISE_SDK_SECRET_ID`
|
|
210
|
+
- `UUID`
|
|
211
|
+
- `AFFISE_APP_OPENED`
|
|
212
|
+
- `PUSHTOKEN`
|
|
213
|
+
- `EVENTS`
|
|
214
|
+
- `AFFISE_EVENTS_COUNT`
|
|
215
|
+
|
|
216
|
+
### Events tracking
|
|
217
|
+
|
|
218
|
+
For example, we want to track what items usually user adds to shopping cart. To send event first create it with
|
|
219
|
+
following code
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
import { Affise, AddToCartEvent } from 'affise-attribution-lib';
|
|
223
|
+
|
|
224
|
+
class Presenter {
|
|
225
|
+
onUserAddsItemsToCart(item: string) {
|
|
226
|
+
const items = {
|
|
227
|
+
items: 'cookies, potato, milk',
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
Affise.sendEvent(new AddToCartEvent(items, Date.now(), 'groceries'));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
With above example you can implement other events:
|
|
236
|
+
|
|
237
|
+
- `AchieveLevelEvent`
|
|
238
|
+
- `AddPaymentInfoEvent`
|
|
239
|
+
- `AddToCartEvent`
|
|
240
|
+
- `AddToWishlistEvent`
|
|
241
|
+
- `ClickAdvEvent`
|
|
242
|
+
- `CompleteRegistrationEvent`
|
|
243
|
+
- `CompleteStreamEvent`
|
|
244
|
+
- `CompleteTrialEvent`
|
|
245
|
+
- `CompleteTutorialEvent`
|
|
246
|
+
- `ContentItemsViewEvent`
|
|
247
|
+
- `DeepLinkedEvent`
|
|
248
|
+
- `InitiatePurchaseEvent`
|
|
249
|
+
- `InitiateStreamEvent`
|
|
250
|
+
- `InviteEvent`
|
|
251
|
+
- `LastAttributedTouchEvent`
|
|
252
|
+
- `ListViewEvent`
|
|
253
|
+
- `LoginEvent`
|
|
254
|
+
- `OpenedFromPushNotificationEvent`
|
|
255
|
+
- `PurchaseEvent`
|
|
256
|
+
- `RateEvent`
|
|
257
|
+
- `ReEngageEvent`
|
|
258
|
+
- `ReserveEvent`
|
|
259
|
+
- `SalesEvent`
|
|
260
|
+
- `SearchEvent`
|
|
261
|
+
- `ShareEvent`
|
|
262
|
+
- `SpendCreditsEvent`
|
|
263
|
+
- `StartRegistrationEvent`
|
|
264
|
+
- `StartTrialEvent`
|
|
265
|
+
- `StartTutorialEvent`
|
|
266
|
+
- `SubscribeEvent`
|
|
267
|
+
- `TravelBookingEvent`
|
|
268
|
+
- `UnlockAchievementEvent`
|
|
269
|
+
- `UnsubscribeEvent`
|
|
270
|
+
- `UnsubscriptionEvent`
|
|
271
|
+
- `UpdateEvent`
|
|
272
|
+
- `ViewAdvEvent`
|
|
273
|
+
- `ViewCartEvent`
|
|
274
|
+
- `ViewItemEvent`
|
|
275
|
+
- `ViewItemsEvent`
|
|
276
|
+
|
|
277
|
+
### Custom events tracking
|
|
278
|
+
|
|
279
|
+
Use any of custom events if default doesn't fit your scenario:
|
|
280
|
+
|
|
281
|
+
- `CustomId01Event`
|
|
282
|
+
- `CustomId02Event`
|
|
283
|
+
- `CustomId03Event`
|
|
284
|
+
- `CustomId04Event`
|
|
285
|
+
- `CustomId05Event`
|
|
286
|
+
- `CustomId06Event`
|
|
287
|
+
- `CustomId07Event`
|
|
288
|
+
- `CustomId08Event`
|
|
289
|
+
- `CustomId09Event`
|
|
290
|
+
- `CustomId10Event`
|
|
291
|
+
|
|
292
|
+
### Predefined event parameters
|
|
293
|
+
|
|
294
|
+
To enrich your event with another dimension, you can use predefined parameters for most common cases.
|
|
295
|
+
Add it to any event:
|
|
296
|
+
|
|
297
|
+
```typescript
|
|
298
|
+
import {
|
|
299
|
+
Affise,
|
|
300
|
+
AddToCartEvent,
|
|
301
|
+
PredefinedParameters,
|
|
302
|
+
} from 'affise-attribution-lib';
|
|
303
|
+
|
|
304
|
+
class Presenter {
|
|
305
|
+
onUserAddsItemsToCart(item: string) {
|
|
306
|
+
const items = {
|
|
307
|
+
items: 'cookies, potato, milk',
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
const event = new AddToCartEvent(items, Date.now());
|
|
311
|
+
|
|
312
|
+
event.addPredefinedParameter(
|
|
313
|
+
PredefinedParameters.DESCRIPTION,
|
|
314
|
+
'best before 2029'
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
Affise.sendEvent(event);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
In examples above `PredefinedParameters.DESCRIPTION` is used, but many others is available:
|
|
323
|
+
|
|
324
|
+
- `ADREV_AD_TYPE`
|
|
325
|
+
- `CITY`
|
|
326
|
+
- `COUNTRY`
|
|
327
|
+
- `REGION`
|
|
328
|
+
- `CLASS`
|
|
329
|
+
- `CONTENT`
|
|
330
|
+
- `CONTENT_ID`
|
|
331
|
+
- `CONTENT_LIST`
|
|
332
|
+
- `CONTENT_TYPE`
|
|
333
|
+
- `CURRENCY`
|
|
334
|
+
- `CUSTOMER_USER_ID`
|
|
335
|
+
- `DATE_A`
|
|
336
|
+
- `DATE_B`
|
|
337
|
+
- `DEPARTING_ARRIVAL_DATE`
|
|
338
|
+
- `DEPARTING_DEPARTURE_DATE`
|
|
339
|
+
- `DESCRIPTION`
|
|
340
|
+
- `DESTINATION_A`
|
|
341
|
+
- `DESTINATION_B`
|
|
342
|
+
- `DESTINATION_LIST`
|
|
343
|
+
- `HOTEL_SCORE`
|
|
344
|
+
- `LEVEL`
|
|
345
|
+
- `MAX_RATING_VALUE`
|
|
346
|
+
- `NUM_ADULTS`
|
|
347
|
+
- `NUM_CHILDREN`
|
|
348
|
+
- `NUM_INFANTS`
|
|
349
|
+
- `ORDER_ID`
|
|
350
|
+
- `PAYMENT_INFO_AVAILABLE`
|
|
351
|
+
- `PREFERRED_NEIGHBORHOODS`
|
|
352
|
+
- `PREFERRED_NUM_STOPS`
|
|
353
|
+
- `PREFERRED_PRICE_RANGE`
|
|
354
|
+
- `PREFERRED_STAR_RATINGS`
|
|
355
|
+
- `PRICE`
|
|
356
|
+
- `PURCHASE_CURRENCY`
|
|
357
|
+
- `QUANTITY`
|
|
358
|
+
- `RATING_VALUE`
|
|
359
|
+
- `RECEIPT_ID`
|
|
360
|
+
- `REGISTRATION_METHOD`
|
|
361
|
+
- `RETURNING_ARRIVAL_DATE`
|
|
362
|
+
- `RETURNING_DEPARTURE_DATE`
|
|
363
|
+
- `REVENUE`
|
|
364
|
+
- `SCORE`
|
|
365
|
+
- `SEARCH_STRING`
|
|
366
|
+
- `SUBSCRIPTION_ID`
|
|
367
|
+
- `SUCCESS`
|
|
368
|
+
- `SUGGESTED_DESTINATIONS`
|
|
369
|
+
- `SUGGESTED_HOTELS`
|
|
370
|
+
- `TRAVEL_START`
|
|
371
|
+
- `TRAVEL_END`
|
|
372
|
+
- `USER_SCORE`
|
|
373
|
+
- `VALIDATED`
|
|
374
|
+
- `ACHIEVEMENT_ID`
|
|
375
|
+
- `COUPON_CODE`
|
|
376
|
+
- `CUSTOMER_SEGMENT`
|
|
377
|
+
- `DEEP_LINK`
|
|
378
|
+
- `EVENT_START`
|
|
379
|
+
- `EVENT_END`
|
|
380
|
+
- `LAT`
|
|
381
|
+
- `LONG`
|
|
382
|
+
- `NEW_VERSION`
|
|
383
|
+
- `OLD_VERSION`
|
|
384
|
+
- `REVIEW_TEXT`
|
|
385
|
+
- `TUTORIAL_ID`
|
|
386
|
+
- `VIRTUAL_CURRENCY_NAME`
|
|
387
|
+
- `PARAM_01`
|
|
388
|
+
- `PARAM_02`
|
|
389
|
+
- `PARAM_03`
|
|
390
|
+
- `PARAM_04`
|
|
391
|
+
- `PARAM_05`
|
|
392
|
+
- `PARAM_06`
|
|
393
|
+
- `PARAM_07`
|
|
394
|
+
- `PARAM_08`
|
|
395
|
+
- `PARAM_09`
|
|
396
|
+
|
|
397
|
+
### Events buffering
|
|
398
|
+
|
|
399
|
+
Affise library will send any pending events with first opportunity,
|
|
400
|
+
but if there is no network connection or device is disabled, events are kept locally for 7 days before deletion.
|
|
401
|
+
|
|
402
|
+
### Advertising Identifier (google) tracking
|
|
403
|
+
|
|
404
|
+
Advertising Identifier (google) tracking is supported automatically, no actions needed
|
|
405
|
+
|
|
406
|
+
### Open Advertising Identifier (huawei) tracking
|
|
407
|
+
|
|
408
|
+
Open Advertising Identifier is supported automatically, no actions needed
|
|
409
|
+
|
|
410
|
+
### Install referrer tracking
|
|
411
|
+
|
|
412
|
+
Install referrer tracking is supported automatically, no actions needed
|
|
413
|
+
|
|
414
|
+
### Push token tracking
|
|
415
|
+
|
|
416
|
+
To let affise track push token you need to receive it from your push service provider, and pass to Affise library.
|
|
417
|
+
First add firebase integration to your app completing theese steps: https://firebase.google.com/docs/cloud-messaging/android/client
|
|
418
|
+
|
|
419
|
+
After you have done with firebase inegration, add to your cloud messaging service `onNewToken` method `Affise.addPushToken(token)`
|
|
420
|
+
|
|
421
|
+
```typescript
|
|
422
|
+
import { Affise } from 'affise-attribution-lib';
|
|
423
|
+
import messaging from '@react-native-firebase/messaging';
|
|
424
|
+
|
|
425
|
+
const getToken = async () => {
|
|
426
|
+
const token = await messaging().getToken();
|
|
427
|
+
if (token) {
|
|
428
|
+
Affise.addPushToken(token);
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
### Reinstall Uninstall tracking
|
|
434
|
+
|
|
435
|
+
Affise automatically track reinstall events by using silent-push technology, to make this feature work, pass push token when it is recreated by user and on you application starts up
|
|
436
|
+
|
|
437
|
+
```typescript
|
|
438
|
+
Affise.addPushToken(token);
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
### APK preinstall tracking
|
|
442
|
+
|
|
443
|
+
SDK is also supports scenario when APK is installed not from one of application markets, such as google play, huawei appgallery or amazon appstore
|
|
444
|
+
To use this feature, create file with name `partner_key` in your app assets directory, and write unique identifier inside, this key will be passed to our backend so you can track events by partner later in your Affise console.
|
|
445
|
+
|
|
446
|
+
### Deeplinks
|
|
447
|
+
|
|
448
|
+
Register deeplink callback right after Affise.init(..)
|
|
449
|
+
|
|
450
|
+
```typescript
|
|
451
|
+
Affise.init(..);
|
|
452
|
+
Affise.registerDeeplinkCallback((uri) => {
|
|
453
|
+
|
|
454
|
+
});
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
#### Android
|
|
458
|
+
|
|
459
|
+
To integrate deeplink support in android you need:
|
|
460
|
+
|
|
461
|
+
Add intent filter to `AndroidManifest.xml` as in `example/android/app/src/main/AndroidManifest.xml`,
|
|
462
|
+
|
|
463
|
+
```xml
|
|
464
|
+
<intent-filter android:autoVerify="true">
|
|
465
|
+
<action android:name="android.intent.action.VIEW" />
|
|
466
|
+
|
|
467
|
+
<category android:name="android.intent.category.DEFAULT" />
|
|
468
|
+
<category android:name="android.intent.category.BROWSABLE" />
|
|
469
|
+
|
|
470
|
+
<data
|
|
471
|
+
android:host="YOUR_AFFISE_APP_ID.affattr.com"
|
|
472
|
+
android:scheme="react" />
|
|
473
|
+
</intent-filter>
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
#### iOS
|
|
477
|
+
|
|
478
|
+
To integrate deeplink support in iOS you need:
|
|
479
|
+
|
|
480
|
+
Add deeplink handler to `AppDelegate.mm` as in `example/ios/AffiseAttributionLibExample/AppDelegate.mm`
|
|
481
|
+
- [React Docs](https://reactnavigation.org/docs/deep-linking/#set-up-with-bare-react-native-projects)
|
|
482
|
+
|
|
483
|
+
```objective-c
|
|
484
|
+
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
|
|
485
|
+
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
|
|
486
|
+
{
|
|
487
|
+
return [RCTLinkingManager application:application openURL:url
|
|
488
|
+
sourceApplication:sourceApplication annotation:annotation];
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
Add key `CFBundleURLTypes` to `Info.plist` as in `example/ios/AffiseAttributionLibExample/Info.plist`
|
|
493
|
+
|
|
494
|
+
```html
|
|
495
|
+
<key>CFBundleURLTypes</key>
|
|
496
|
+
<array>
|
|
497
|
+
<dict>
|
|
498
|
+
<key>CFBundleTypeRole</key>
|
|
499
|
+
<string>Editor</string>
|
|
500
|
+
<key>CFBundleURLName</key>
|
|
501
|
+
<string>YOUR_AFFISE_APP_ID.affattr.com</string>
|
|
502
|
+
<key>CFBundleURLSchemes</key>
|
|
503
|
+
<array>
|
|
504
|
+
<string>react</string>
|
|
505
|
+
</array>
|
|
506
|
+
</dict>
|
|
507
|
+
</array>
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### Offline mode
|
|
511
|
+
|
|
512
|
+
In some scenarious you would want to limit Affise network usage, to pause that activity call anywhere in your application following code after Affise init:
|
|
513
|
+
|
|
514
|
+
```typescript
|
|
515
|
+
Affise.init(..);
|
|
516
|
+
Affise.setOfflineModeEnabled(true); // to enable offline mode
|
|
517
|
+
Affise.setOfflineModeEnabled(false); // to disable offline mode
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
While offline mode is enabled, your metrics and other events are kept locally, and will be delivered once offline mode is disabled.
|
|
521
|
+
Offline mode is persistent as Application lifecycle, and will be disabled with process termination automaticly.
|
|
522
|
+
To check current offline mode status call:
|
|
523
|
+
|
|
524
|
+
```typescript
|
|
525
|
+
Affise.isOfflineModeEnabled(); // returns true or false describing current tracking state
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### Disable tracking
|
|
529
|
+
|
|
530
|
+
To disable any tracking activity, storing events and gathering device identifiers and metrics call anywhere in your application following code after Affise init:
|
|
531
|
+
|
|
532
|
+
```typescript
|
|
533
|
+
Affise.init(..);
|
|
534
|
+
Affise.setTrackingEnabled(true); // to enable tracking
|
|
535
|
+
Affise.setTrackingEnabled(false); // to disable tracking
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
By default tracking is enabled.
|
|
539
|
+
|
|
540
|
+
While tracking mode is disabled, metrics and other identifiers is not generated locally.
|
|
541
|
+
Keep in mind that this flag is persistent until app reinstall, and don't forget to reactivate tracking when needed.
|
|
542
|
+
To check current status of tracking call:
|
|
543
|
+
|
|
544
|
+
```typescript
|
|
545
|
+
Affise.isTrackingEnabled().then((enabled) => {
|
|
546
|
+
// returns true or false describing current tracking state
|
|
547
|
+
});
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
### Disable background tracking
|
|
551
|
+
|
|
552
|
+
To disable any background tracking activity, storing events and gathering device identifiers and metrics call anywhere in your application following code after Affise init:
|
|
553
|
+
|
|
554
|
+
```typescript
|
|
555
|
+
Affise.init(..);
|
|
556
|
+
Affise.setBackgroundTrackingEnabled(true); // to enable background tracking
|
|
557
|
+
Affise.setBackgroundTrackingEnabled(false); // to disable background tracking
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
By default background tracking is enabled.
|
|
561
|
+
|
|
562
|
+
While background tracking mode is disabled, metrics and other identifiers is not generated locally.
|
|
563
|
+
Background tracking mode is persistent as Application lifecycle, and will be re-enabled with process termination automatically.
|
|
564
|
+
To check current status of background tracking call:
|
|
565
|
+
|
|
566
|
+
```typescript
|
|
567
|
+
Affise.isBackgroundTrackingEnabled().then((enabled) => {
|
|
568
|
+
// returns true or false describing current background tracking state
|
|
569
|
+
});
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### GDPR right to be forgotten
|
|
573
|
+
|
|
574
|
+
Under the EU's General Data Protection Regulation (GDPR): An individual has the right to have their personal data erased.
|
|
575
|
+
To provide this functionality to user, as the app developer, you can call
|
|
576
|
+
|
|
577
|
+
```typescript
|
|
578
|
+
Affise.init(..);
|
|
579
|
+
Affise.forget(); // to forget users data
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
After processing such request our backend servers will delete all users data.
|
|
583
|
+
To prevent library from generating new events, disable tracking just before calling Affise.forget:
|
|
584
|
+
|
|
585
|
+
```typescript
|
|
586
|
+
Affise.init(..);
|
|
587
|
+
Affise.setTrackingEnabled(false);
|
|
588
|
+
Affise.forget(); // to forget users data
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
### Platform specific
|
|
593
|
+
|
|
594
|
+
### Get referrer
|
|
595
|
+
> `Android Only`
|
|
596
|
+
|
|
597
|
+
Use the next public method of SDK
|
|
598
|
+
|
|
599
|
+
```typescript
|
|
600
|
+
Affise.getReferrer().then((referrer) => {
|
|
601
|
+
// returns referrer
|
|
602
|
+
});
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
#### Get referrer value
|
|
606
|
+
> `Android Only`
|
|
607
|
+
|
|
608
|
+
Use the next public method of SDK to get referrer value by
|
|
609
|
+
|
|
610
|
+
```typescript
|
|
611
|
+
Affise.android.getReferrerValue(ReferrerKey.CLICK_ID, (value) => {
|
|
612
|
+
|
|
613
|
+
})
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
#### Referrer keys
|
|
617
|
+
|
|
618
|
+
In examples above `ReferrerKey.CLICK_ID` is used, but many others is available:
|
|
619
|
+
|
|
620
|
+
- `AD_ID`
|
|
621
|
+
- `CAMPAIGN_ID`
|
|
622
|
+
- `CLICK_ID`
|
|
623
|
+
- `AFFISE_AD`
|
|
624
|
+
- `AFFISE_AD_ID`
|
|
625
|
+
- `AFFISE_AD_TYPE`
|
|
626
|
+
- `AFFISE_ADSET`
|
|
627
|
+
- `AFFISE_ADSET_ID`
|
|
628
|
+
- `AFFISE_AFFC_ID`
|
|
629
|
+
- `AFFISE_CHANNEL`
|
|
630
|
+
- `AFFISE_CLICK_LOOK_BACK`
|
|
631
|
+
- `AFFISE_COST_CURRENCY`
|
|
632
|
+
- `AFFISE_COST_MODEL`
|
|
633
|
+
- `AFFISE_COST_VALUE`
|
|
634
|
+
- `AFFISE_DEEPLINK`
|
|
635
|
+
- `AFFISE_KEYWORDS`
|
|
636
|
+
- `AFFISE_MEDIA_TYPE`
|
|
637
|
+
- `AFFISE_MODEL`
|
|
638
|
+
- `AFFISE_OS`
|
|
639
|
+
- `AFFISE_PARTNER`
|
|
640
|
+
- `AFFISE_REF`
|
|
641
|
+
- `AFFISE_SITE_ID`
|
|
642
|
+
- `AFFISE_SUB_SITE_ID`
|
|
643
|
+
- `AFFC`
|
|
644
|
+
- `PID`
|
|
645
|
+
- `SUB_1`
|
|
646
|
+
- `SUB_2`
|
|
647
|
+
- `SUB_3`
|
|
648
|
+
- `SUB_4`
|
|
649
|
+
- `SUB_5`
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
#### SKAd
|
|
653
|
+
> `iOS Only`
|
|
654
|
+
|
|
655
|
+
For ios prior `16.1` first call
|
|
656
|
+
```typescript
|
|
657
|
+
Affise.ios.registerAppForAdNetworkAttribution((error) => {
|
|
658
|
+
|
|
659
|
+
});
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
Updates the fine and coarse conversion values, and calls a completion handler if the update fails.
|
|
663
|
+
Second argument coarseValue is available in iOS 16.1+
|
|
664
|
+
```typescript
|
|
665
|
+
Affise.ios.updatePostbackConversionValue(1, "medium", (error) => {
|
|
666
|
+
|
|
667
|
+
});
|
|
668
|
+
```
|