@@ -9,7 +9,11 @@ import {
9
9
ErrorType ,
10
10
} from '@segment/analytics-react-native' ;
11
11
import type { SegmentAppsflyerSettings } from './types' ;
12
- import appsFlyer from 'react-native-appsflyer' ;
12
+ import appsFlyer , {
13
+ ConversionData ,
14
+ OnAppOpenAttributionData ,
15
+ UnifiedDeepLinkData ,
16
+ } from 'react-native-appsflyer' ;
13
17
import identify from './methods/identify' ;
14
18
import track from './methods/track' ;
15
19
@@ -19,6 +23,9 @@ export class AppsflyerPlugin extends DestinationPlugin {
19
23
is_adset : boolean ;
20
24
is_adset_id : boolean ;
21
25
is_ad_id : boolean ;
26
+ onDeepLink ?: ( data : UnifiedDeepLinkData ) => void ;
27
+ onInstallConversionData ?: ( data : ConversionData ) => void ;
28
+ onAppOpenAttribution ?: ( data : OnAppOpenAttributionData ) => void ;
22
29
} ) {
23
30
super ( ) ;
24
31
if ( props != null ) {
@@ -28,13 +35,19 @@ export class AppsflyerPlugin extends DestinationPlugin {
28
35
this . is_ad_id = props . is_ad_id === undefined ? false : props . is_ad_id ;
29
36
this . is_adset_id =
30
37
props . is_adset_id === undefined ? false : props . is_adset_id ;
38
+ this . onDeepLink = props . onDeepLink ;
39
+ this . onInstallConversionData = props . onInstallConversionData ;
40
+ this . onAppOpenAttribution = props . onAppOpenAttribution ;
31
41
}
32
42
}
33
43
type = PluginType . destination ;
34
44
key = 'AppsFlyer' ;
35
45
is_adset = false ;
36
46
is_adset_id = false ;
37
47
is_ad_id = false ;
48
+ onDeepLink ?: ( data : UnifiedDeepLinkData ) => void ;
49
+ onInstallConversionData ?: ( data : ConversionData ) => void ;
50
+ onAppOpenAttribution ?: ( data : OnAppOpenAttributionData ) => void ;
38
51
private settings : SegmentAppsflyerSettings | null = null ;
39
52
private hasRegisteredInstallCallback = false ;
40
53
private hasRegisteredDeepLinkCallback = false ;
@@ -153,6 +166,7 @@ export class AppsflyerPlugin extends DestinationPlugin {
153
166
) ;
154
167
}
155
168
}
169
+ this . onInstallConversionData ?.( res ) ;
156
170
} ) ;
157
171
} ;
158
172
@@ -175,6 +189,7 @@ export class AppsflyerPlugin extends DestinationPlugin {
175
189
)
176
190
) ;
177
191
}
192
+ this . onAppOpenAttribution ?.( res ) ;
178
193
} ) ;
179
194
} ;
180
195
@@ -197,6 +212,7 @@ export class AppsflyerPlugin extends DestinationPlugin {
197
212
)
198
213
) ;
199
214
}
215
+ this . onDeepLink ?.( res ) ;
200
216
} ) ;
201
217
} ;
202
218
}
0 commit comments