@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
2
2
import { Cordova , AwesomeCordovaNativePlugin , Plugin } from '@awesome-cordova-plugins/core' ;
3
3
4
4
export class AdjustConfig {
5
+ // common
5
6
private appToken : string ;
6
7
private environment : AdjustEnvironment ;
7
8
private sdkPrefix : string ;
@@ -17,6 +18,15 @@ export class AdjustConfig {
17
18
private urlStrategyDomains : string [ ] = [ ] ;
18
19
private useSubdomains : boolean = null ;
19
20
private isDataResidency : boolean = null ;
21
+ private isFirstSessionDelayEnabled : boolean = null ;
22
+ private storeInfo : AdjustStoreInfo = null ;
23
+
24
+ private attributionCallback : ( attribution : AdjustAttribution ) => void = null ;
25
+ private eventTrackingSucceededCallback : ( event : AdjustEventSuccess ) => void = null ;
26
+ private eventTrackingFailedCallback : ( event : AdjustEventFailure ) => void = null ;
27
+ private sessionTrackingSucceededCallback : ( session : AdjustSessionSuccess ) => void = null ;
28
+ private sessionTrackingFailedCallback : ( session : AdjustSessionFailure ) => void = null ;
29
+ private deferredDeeplinkCallback : ( deeplink : string ) => void = null ;
20
30
21
31
// android only
22
32
private processName : string = null ;
@@ -32,16 +42,10 @@ export class AdjustConfig {
32
42
private isSkanAttributionEnabled : boolean = null ;
33
43
private isLinkMeEnabled : boolean = null ;
34
44
private attConsentWaitingInterval : number = null ;
35
-
36
- // callbacks
37
- private attributionCallback : ( attribution : AdjustAttribution ) => void = null ;
38
- private eventTrackingSucceededCallback : ( event : AdjustEventSuccess ) => void = null ;
39
- private eventTrackingFailedCallback : ( event : AdjustEventFailure ) => void = null ;
40
- private sessionTrackingSucceededCallback : ( session : AdjustSessionSuccess ) => void = null ;
41
- private sessionTrackingFailedCallback : ( session : AdjustSessionFailure ) => void = null ;
42
- private deferredDeeplinkCallback : ( deeplink : string ) => void = null ;
45
+ private isAppTrackingTransparencyUsageEnabled : boolean = null ;
43
46
private skanUpdatedCallback : ( skanData : AdjustSkanData ) => void = null ;
44
47
48
+ // common
45
49
constructor ( appToken : string , environment : AdjustEnvironment ) {
46
50
this . appToken = appToken ;
47
51
this . environment = environment ;
@@ -60,7 +64,9 @@ export class AdjustConfig {
60
64
}
61
65
62
66
setUrlStrategy ( urlStrategyDomains : string [ ] , useSubdomains : boolean , isDataResidency : boolean ) : void {
63
- this . urlStrategy = urlStrategy ;
67
+ this . urlStrategyDomains = urlStrategyDomains ;
68
+ this . useSubdomains = useSubdomains ;
69
+ this . isDataResidency = isDataResidency ;
64
70
}
65
71
66
72
enableSendingInBackground ( ) : void {
@@ -87,44 +93,12 @@ export class AdjustConfig {
87
93
this . isCostDataInAttributionEnabled = true ;
88
94
}
89
95
90
- setProcessName ( processName : string ) {
91
- this . processName = processName ;
92
- }
93
-
94
- enablePreinstallTracking ( ) : void {
95
- this . isPreinstallTrackingEnabled = true ;
96
- }
97
-
98
- setPreinstallFilePath ( preinstallFilePath : string ) : void {
99
- this . preinstallFilePath = preinstallFilePath ;
100
- }
101
-
102
- setFbAppId ( fbAppId : string ) : void {
103
- this . fbAppId = fbAppId ;
104
- }
105
-
106
- disableIdfaReading ( ) : void {
107
- this . isIdfaReadingEnabled = false ;
96
+ enableFirstSessionDelay ( ) : void {
97
+ this . isFirstSessionDelayEnabled = true ;
108
98
}
109
99
110
- disableIdfvReading ( ) : void {
111
- this . isIdfvReadingEnabled = false ;
112
- }
113
-
114
- disableAdServices ( ) : void {
115
- this . isAdServicesEnabled = false ;
116
- }
117
-
118
- enableLinkMe ( ) : void {
119
- this . isLinkMeEnabled = true ;
120
- }
121
-
122
- disableSkanAttribution ( ) : void {
123
- this . isSkanAttributionEnabled = false ;
124
- }
125
-
126
- setAttConsentWaitingInterval ( attConsentWaitingInterval : number ) : void {
127
- this . attConsentWaitingInterval = attConsentWaitingInterval ;
100
+ setStoreInfo ( storeInfo : AdjustStoreInfo ) : void {
101
+ this . storeInfo = storeInfo ;
128
102
}
129
103
130
104
setAttributionCallback ( attributionCallback : ( attribution : AdjustAttribution ) => void ) : void {
@@ -151,63 +125,109 @@ export class AdjustConfig {
151
125
this . deferredDeeplinkCallback = deferredDeeplinkCallback ;
152
126
}
153
127
154
- setSkanUpdatedCallback ( skanUpdatedCallback : ( skanData : AdjustSkanData ) => void ) : void {
155
- this . skanUpdatedCallback = skanUpdatedCallback ;
156
- }
157
-
158
- private getAttributionCallback ( ) : void {
128
+ private getAttributionCallback ( ) : ( ( attribution : AdjustAttribution ) => void ) | null {
159
129
return this . attributionCallback ;
160
130
}
161
131
162
- private getEventTrackingSucceededCallback ( ) : void {
132
+ private getEventTrackingSucceededCallback ( ) : ( ( event : AdjustEventSuccess ) => void ) | null {
163
133
return this . eventTrackingSucceededCallback ;
164
134
}
165
135
166
- private getEventTrackingFailedCallback ( ) : void {
136
+ private getEventTrackingFailedCallback ( ) : ( ( event : AdjustEventFailure ) => void ) | null {
167
137
return this . eventTrackingFailedCallback ;
168
138
}
169
139
170
- private getSessionTrackingSucceededCallback ( ) : void {
140
+ private getSessionTrackingSucceededCallback ( ) : ( ( session : AdjustSessionSuccess ) => void ) | null {
171
141
return this . sessionTrackingSucceededCallback ;
172
142
}
173
143
174
- private getSessionTrackingFailedCallback ( ) : void {
144
+ private getSessionTrackingFailedCallback ( ) : ( ( session : AdjustSessionFailure ) => void ) | null {
175
145
return this . sessionTrackingFailedCallback ;
176
146
}
177
147
178
- private getDeferredDeeplinkCallback ( ) : void {
148
+ private getDeferredDeeplinkCallback ( ) : ( ( deeplink : string ) => void ) | null {
179
149
return this . deferredDeeplinkCallback ;
180
150
}
181
151
182
- private getSkanUpdatedCallback ( ) : void {
183
- return this . skanUpdatedCallback ;
184
- }
185
-
186
- private hasAttributionCallback ( ) : void {
152
+ private hasAttributionCallback ( ) : boolean {
187
153
return this . attributionCallback !== null ;
188
154
}
189
155
190
- private hasEventTrackingSucceededCallback ( ) : void {
156
+ private hasEventTrackingSucceededCallback ( ) : boolean {
191
157
return this . eventTrackingSucceededCallback !== null ;
192
158
}
193
159
194
- private hasEventTrackingFailedCallback ( ) : void {
160
+ private hasEventTrackingFailedCallback ( ) : boolean {
195
161
return this . eventTrackingFailedCallback !== null ;
196
162
}
197
163
198
- private hasSessionTrackingSucceededCallback ( ) : void {
164
+ private hasSessionTrackingSucceededCallback ( ) : boolean {
199
165
return this . sessionTrackingSucceededCallback !== null ;
200
166
}
201
167
202
- private hasSessionTrackingFailedCallback ( ) : void {
168
+ private hasSessionTrackingFailedCallback ( ) : boolean {
203
169
return this . sessionTrackingFailedCallback !== null ;
204
170
}
205
171
206
- private hasDeferredDeeplinkCallback ( ) : void {
172
+ private hasDeferredDeeplinkCallback ( ) : boolean {
207
173
return this . deferredDeeplinkCallback !== null ;
208
174
}
209
175
210
- private hasSkanUpdatedCallback ( ) : void {
176
+ // android only
177
+ setProcessName ( processName : string ) : void {
178
+ this . processName = processName ;
179
+ }
180
+
181
+ enablePreinstallTracking ( ) : void {
182
+ this . isPreinstallTrackingEnabled = true ;
183
+ }
184
+
185
+ setPreinstallFilePath ( preinstallFilePath : string ) : void {
186
+ this . preinstallFilePath = preinstallFilePath ;
187
+ }
188
+
189
+ setFbAppId ( fbAppId : string ) : void {
190
+ this . fbAppId = fbAppId ;
191
+ }
192
+
193
+ // ios only
194
+ disableIdfaReading ( ) : void {
195
+ this . isIdfaReadingEnabled = false ;
196
+ }
197
+
198
+ disableIdfvReading ( ) : void {
199
+ this . isIdfvReadingEnabled = false ;
200
+ }
201
+
202
+ disableAdServices ( ) : void {
203
+ this . isAdServicesEnabled = false ;
204
+ }
205
+
206
+ enableLinkMe ( ) : void {
207
+ this . isLinkMeEnabled = true ;
208
+ }
209
+
210
+ disableSkanAttribution ( ) : void {
211
+ this . isSkanAttributionEnabled = false ;
212
+ }
213
+
214
+ setAttConsentWaitingInterval ( attConsentWaitingInterval : number ) : void {
215
+ this . attConsentWaitingInterval = attConsentWaitingInterval ;
216
+ }
217
+
218
+ disableAppTrackingTransparencyUsage ( ) : void {
219
+ this . isAppTrackingTransparencyUsageEnabled = false ;
220
+ }
221
+
222
+ setSkanUpdatedCallback ( skanUpdatedCallback : ( skanData : AdjustSkanData ) => void ) : void {
223
+ this . skanUpdatedCallback = skanUpdatedCallback ;
224
+ }
225
+
226
+ private getSkanUpdatedCallback ( ) : ( ( skanData : AdjustSkanData ) => void ) | null {
227
+ return this . skanUpdatedCallback ;
228
+ }
229
+
230
+ private hasSkanUpdatedCallback ( ) : boolean {
211
231
return this . skanUpdatedCallback !== null ;
212
232
}
213
233
}
@@ -424,10 +444,28 @@ export class AdjustPlayStorePurchase {
424
444
425
445
export class AdjustDeeplink {
426
446
private deeplink : string ;
447
+ private referrer : string ;
427
448
428
449
constructor ( deeplink : string ) {
429
450
this . deeplink = deeplink ;
430
451
}
452
+
453
+ setReferrer ( referrer : string ) : void {
454
+ this . referrer = referrer ;
455
+ }
456
+ }
457
+
458
+ export class AdjustStoreInfo {
459
+ private storeName : string ;
460
+ private storeAppId : string ;
461
+
462
+ constructor ( storeName : string ) {
463
+ this . storeName = storeName ;
464
+ }
465
+
466
+ setStoreAppId ( storeAppId : string ) : void {
467
+ this . storeAppId = storeAppId ;
468
+ }
431
469
}
432
470
433
471
export interface AdjustAttribution {
@@ -443,6 +481,7 @@ export interface AdjustAttribution {
443
481
costAmount : string ;
444
482
costCurrency : string ;
445
483
fbInstallReferrer : string ; // android only
484
+ jsonResponse : string ;
446
485
}
447
486
448
487
export interface AdjustSessionSuccess {
@@ -546,6 +585,7 @@ export enum AdjustLogLevel {
546
585
* AdjustAppStorePurchase
547
586
* AdjustPlayStorePurchase
548
587
* AdjustDeeplink
588
+ * AdjustStoreInfo
549
589
* @enums
550
590
* AdjustEnvironment
551
591
* AdjustLogLevel
@@ -562,7 +602,7 @@ export class Adjust extends AwesomeCordovaNativePlugin {
562
602
/**
563
603
* This method initializes Adjust SDK
564
604
*
565
- * @param {AdjustConig } adjustConfig Adjust config object used as starting options
605
+ * @param {AdjustConfig } adjustConfig Adjust config object used as starting options
566
606
*/
567
607
@Cordova ( { sync : true } )
568
608
initSdk ( adjustConfig : AdjustConfig ) : void { }
@@ -863,4 +903,42 @@ export class Adjust extends AwesomeCordovaNativePlugin {
863
903
verifyPlayStorePurchase ( adjustPlayStorePurchase : AdjustPlayStorePurchase ) : Promise < AdjustPurchaseVerificationResult > {
864
904
return ;
865
905
}
866
- }
906
+
907
+ /**
908
+ * This method ends first session delay
909
+ */
910
+ @Cordova ( { sync : true } )
911
+ endFirstSessionDelay ( ) : void { }
912
+
913
+ /**
914
+ * This method enables COPPA compliance while in first session delay
915
+ */
916
+ @Cordova ( { sync : true } )
917
+ enableCoppaComplianceInDelay ( ) : void { }
918
+
919
+ /**
920
+ * This method disables COPPA compliance while in first session delay
921
+ */
922
+ @Cordova ( { sync : true } )
923
+ disableCoppaComplianceInDelay ( ) : void { }
924
+
925
+ /**
926
+ * This method enables Play Store Kids compliance while in first session delay
927
+ */
928
+ @Cordova ( { sync : true } )
929
+ enablePlayStoreKidsComplianceInDelay ( ) : void { }
930
+
931
+ /**
932
+ * This method disables Play Store Kids compliance while in first session delay
933
+ */
934
+ @Cordova ( { sync : true } )
935
+ disablePlayStoreKidsComplianceInDelay ( ) : void { }
936
+
937
+ /**
938
+ * This method allows you to set external device ID while in first session delay
939
+ *
940
+ * @param {string } externalDeviceId External device ID value
941
+ */
942
+ @Cordova ( { sync : true } )
943
+ setExternalDeviceIdInDelay ( externalDeviceId : string ) : void { }
944
+ }
0 commit comments