1
1
# Affise Attribution Flutter Library
2
2
3
+ | Package | Version |
4
+ | --------------------------| :-------:|
5
+ | ` affise_attribution_lib ` | [ ` 1.6.1 ` ] ( https://github.com/affise/sdk-react/releases ) |
6
+
3
7
- [ Affise Attribution Flutter Library] ( #affise-attribution-flutter-library )
4
8
- [ Description] ( #description )
5
9
- [ Quick start] ( #quick-start )
6
10
- [ Integration] ( #integration )
7
11
- [ Integrate as dependency] ( #integrate-as-dependency )
8
12
- [ Add platform modules] ( #add-platform-modules )
9
13
- [ Android] ( #android )
14
+ - [ iOS] ( #ios )
10
15
- [ Initialize] ( #initialize )
11
16
- [ Requirements] ( #requirements )
12
17
- [ Android] ( #android-1 )
30
35
- [ APK preinstall tracking] ( #apk-preinstall-tracking )
31
36
- [ Deeplinks] ( #deeplinks )
32
37
- [ Android] ( #android-2 )
33
- - [ iOS] ( #ios )
38
+ - [ iOS] ( #ios-1 )
34
39
- [ Offline mode] ( #offline-mode )
35
40
- [ Disable tracking] ( #disable-tracking )
36
41
- [ Disable background tracking] ( #disable-background-tracking )
37
- - [ GDPR right to be forgotten] ( #gdpr-right-to-be-forgotten )
38
42
- [ Get random user Id] ( #get-random-user-id )
39
43
- [ Get random device Id] ( #get-random-device-id )
40
44
- [ Get module state] ( #get-module-state )
41
45
- [ Platform specific] ( #platform-specific )
46
+ - [ GDPR right to be forgotten] ( #gdpr-right-to-be-forgotten )
42
47
- [ Get referrer] ( #get-referrer )
43
48
- [ Get referrer value] ( #get-referrer-value )
44
49
- [ Referrer keys] ( #referrer-keys )
@@ -73,23 +78,48 @@ dependencies:
73
78
74
79
Add modules to android project
75
80
81
+ | Module | Version |
82
+ |--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
83
+ | ` module-advertising` | [](https://mvnrepository.com/artifact/com.affise/module-advertising) |
84
+ | `module-network` | [](https://mvnrepository.com/artifact/com.affise/module-network) |
85
+ | `module-phone` | [](https://mvnrepository.com/artifact/com.affise/module-phone) |
86
+ | `module-status` | [](https://mvnrepository.com/artifact/com.affise/module-status)
87
+
76
88
Example [`example/android/app/build.gradle`](example/android/app/build.gradle)
77
89
78
90
` ` ` gradle
79
91
dependencies {
80
92
// Affise modules
81
- implementation 'com.affise:module-advertising:1.6.7 '
82
- implementation 'com.affise:module-network:1.6.7 '
83
- implementation 'com.affise:module-phone:1.6.7 '
84
- implementation 'com.affise:module-status:1.6.7 '
93
+ implementation 'com.affise:module-advertising:1.6.+ '
94
+ implementation 'com.affise:module-network:1.6.+ '
95
+ implementation 'com.affise:module-phone:1.6.+ '
96
+ implementation 'com.affise:module-status:1.6.+ '
85
97
}
86
98
` ` `
87
99
100
+ # ### iOS
101
+
102
+ Add modules to iOS project
103
+
104
+ | Module | Version |
105
+ |-----------------------|:-------:|
106
+ | `AffiseModule/Status` | `1.6.9` |
107
+
108
+ Example [example/ios/Podfile](example/ios/Podfile)
109
+
110
+ ` ` ` ruby
111
+ target 'Runner' do
112
+ # ...
113
+
114
+ # Affise Module
115
+ pod 'AffiseModule/Status', ` ~> 1.6.9`
116
+ end
117
+
88
118
# ## Initialize
89
119
90
120
After dependency is added, sync project with `flutter pub get` and initialize.
91
121
92
- > Demo app [main.dart](example/lib/main.dart)
122
+ > Demo app [` main.dart` ](example/lib/main.dart)
93
123
94
124
` ` ` dart
95
125
import 'package:flutter/foundation.dart';
@@ -110,6 +140,12 @@ class _MyAppState extends State<MyApp> {
110
140
}
111
141
` ` `
112
142
143
+ Check if library is initialized
144
+
145
+ ` ` ` dart
146
+ Affise.isInitialized();
147
+ ` ` `
148
+
113
149
# ## Requirements
114
150
115
151
# ### Android
@@ -350,8 +386,9 @@ class Presenter {
350
386
timeStampMillis: DateTime.now().millisecondsSinceEpoch,
351
387
);
352
388
353
- event.addPredefinedString(PredefinedString.DESCRIPTION, "best before 2029");
354
- event.addPredefinedObject(PredefinedObject.CONTENT, items);
389
+ event
390
+ .addPredefinedString(PredefinedString.DESCRIPTION, "best before 2029")
391
+ .addPredefinedObject(PredefinedObject.CONTENT, items);
355
392
356
393
Affise.sendEvent(event);
357
394
}
@@ -375,12 +412,16 @@ In examples above `PredefinedParameters.DESCRIPTION` and `PredefinedObject.CONTE
375
412
- ` ADREV_AD_TYPE`
376
413
- ` BRAND`
377
414
- ` BRICK`
415
+ - ` CAMPAIGN_ID`
378
416
- ` CATALOGUE_ID`
379
417
- ` CHANNEL_TYPE`
380
418
- ` CITY`
381
419
- ` CLASS`
420
+ - ` CLICK_ID`
382
421
- ` CONTENT_ID`
422
+ - ` CONTENT_NAME`
383
423
- ` CONTENT_TYPE`
424
+ - ` CONVERSION_ID`
384
425
- ` COUNTRY`
385
426
- ` COUPON_CODE`
386
427
- ` CURRENCY`
@@ -392,6 +433,7 @@ In examples above `PredefinedParameters.DESCRIPTION` and `PredefinedObject.CONTE
392
433
- ` DESTINATION_A`
393
434
- ` DESTINATION_B`
394
435
- ` DESTINATION_LIST`
436
+ - ` EVENT_NAME`
395
437
- ` NEW_VERSION`
396
438
- ` OLD_VERSION`
397
439
- ` ORDER_ID`
@@ -406,7 +448,10 @@ In examples above `PredefinedParameters.DESCRIPTION` and `PredefinedObject.CONTE
406
448
- ` PARAM_09`
407
449
- ` PARAM_10`
408
450
- ` PAYMENT_INFO_AVAILABLE`
451
+ - ` PID`
409
452
- ` PREFERRED_NEIGHBORHOODS`
453
+ - ` PRODUCT_ID`
454
+ - ` PRODUCT_NAME`
410
455
- ` PURCHASE_CURRENCY`
411
456
- ` RECEIPT_ID`
412
457
- ` REGION`
@@ -587,7 +632,7 @@ To integrate deeplink support in iOS you need:
587
632
588
633
Add key `CFBundleURLTypes` to `Info.plist`
589
634
590
- Example : ` example/ios/Runner/Info.plist`
635
+ Example : [ `example/ios/Runner/Info.plist`](example/ios/Runner/Info.plist)
591
636
592
637
` ` ` xml
593
638
<key>CFBundleURLTypes</key>
@@ -663,53 +708,49 @@ To check current status of background tracking call:
663
708
Affise.isBackgroundTrackingEnabled(); // returns true or false describing current background tracking state
664
709
` ` `
665
710
666
- # # GDPR right to be forgotten
667
-
668
- Under the EU's General Data Protection Regulation (GDPR) : An individual has the right to have their personal data erased.
669
- To provide this functionality to user, as the app developer, you can call
711
+ # # Get random user Id
670
712
671
713
` ` ` dart
672
- Affise.init(..);
673
- Affise.forget(); // to forget users data
714
+ Affise.getRandomUserId();
674
715
` ` `
675
716
676
- After processing such request our backend servers will delete all users data.
677
- To prevent library from generating new events, disable tracking just before calling Affise.forget :
717
+ # # Get random device Id
678
718
679
719
` ` ` dart
680
- Affise.init(..);
681
- Affise.setTrackingEnabled(false);
682
- Affise.forget(); // to forget users data
720
+ Affise.getRandomDeviceId();
683
721
` ` `
684
722
685
- # # Get random user Id
686
-
687
- Use the next public method of SDK
723
+ # # Get module state
688
724
689
725
` ` ` dart
690
- Affise.GetRandomUserId();
726
+ Affise.getStatus(AffiseModules.STATUS, (response) {
727
+ // handle status response
728
+ });
691
729
` ` `
692
730
693
- # # Get random device Id
731
+ # # Platform specific
694
732
695
- Use the next public method of SDK
733
+ # ## GDPR right to be forgotten
734
+
735
+ > `Android Only`
736
+
737
+ Under the EU's General Data Protection Regulation (GDPR) : An individual has the right to have their personal data erased.
738
+ To provide this functionality to user, as the app developer, you can call
696
739
697
740
` ` ` dart
698
- Affise.GetRandomDeviceId();
741
+ Affise.init(..);
742
+ Affise.android.forget(); // to forget users data
699
743
` ` `
700
744
701
- # # Get module state
702
-
703
- > Implemented for `Android`
745
+ After processing such request our backend servers will delete all users data.
746
+ To prevent library from generating new events, disable tracking just before calling Affise.forget :
704
747
705
748
` ` ` dart
706
- Affise.GetStatus(AffiseModules.STATUS, (response) {
707
- // handle response
708
- });
749
+ Affise.init(..);
750
+ Affise.setTrackingEnabled(false);
751
+ Affise.android.forget(); // to forget users data
709
752
` ` `
710
753
711
- # # Platform specific
712
-
713
754
# ## Get referrer
714
755
715
756
> `Android Only`
@@ -795,7 +836,7 @@ Configure your app to send postback copies to Affise:
795
836
Add key `NSAdvertisingAttributionReportEndpoint` to `Info.plist`
796
837
Set key value to `https://affise-skadnetwork.com/`
797
838
798
- Example : ` example/ios/Runner/Info.plist`
839
+ Example : [ `example/ios/Runner/Info.plist`](example/ios/Runner/Info.plist)
799
840
800
841
` ` ` xml
801
842
<key>CFBundleURLTypes</key>
0 commit comments