@@ -12,43 +12,44 @@ const FLAG = '$RNFirebaseAnalyticsWithoutAdIdSupport = true';
1212const TAG_ODM = '@react-native-firebase/analytics-googleAppMeasurementOnDeviceConversion' ;
1313const FLAG_ODM = '$RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion = true' ;
1414
15- export function setAnalyticsPodfileWithoutAdIdSupport (
15+ function setAnalyticsPodfileFlag (
1616 src : string ,
17+ tag : string ,
18+ flag : string ,
1719 enabled : boolean = false ,
1820) : string {
1921 if ( ! enabled ) {
20- return removeGeneratedContents ( src , TAG ) ?? src ;
22+ return removeGeneratedContents ( src , tag ) ?? src ;
2123 }
2224
2325 return mergeContents ( {
2426 src,
25- newSrc : FLAG ,
26- tag : TAG ,
27+ newSrc : flag ,
28+ tag,
2729 anchor : ANCHOR ,
2830 offset : 1 ,
2931 comment : '#' ,
3032 } ) . contents ;
3133}
3234
33- export function setAnalyticsPodfileGoogleAppMeasurementOnDeviceConversion (
35+ export function setAnalyticsPodfileWithoutAdIdSupport (
3436 src : string ,
3537 enabled : boolean = false ,
3638) : string {
37- if ( ! enabled ) {
38- return removeGeneratedContents ( src , TAG_ODM ) ?? src ;
39- }
39+ return setAnalyticsPodfileFlag ( src , TAG , FLAG , enabled ) ;
40+ }
4041
41- return mergeContents ( {
42- src,
43- newSrc : FLAG_ODM ,
44- tag : TAG_ODM ,
45- anchor : ANCHOR ,
46- offset : 1 ,
47- comment : '#' ,
48- } ) . contents ;
42+ export function setAnalyticsPodfileGoogleAppMeasurementOnDeviceConversion (
43+ src : string ,
44+ enabled : boolean = false ,
45+ ) : string {
46+ return setAnalyticsPodfileFlag ( src , TAG_ODM , FLAG_ODM , enabled ) ;
4947}
5048
51- export const withIosGoogleAppMeasurementOnDeviceConversion : ConfigPlugin < PluginConfigType > = ( config , props ) => {
49+ export const withIosGoogleAppMeasurementOnDeviceConversion : ConfigPlugin < PluginConfigType > = (
50+ config ,
51+ props ,
52+ ) => {
5253 return withPodfile ( config , config => {
5354 config . modResults . contents = setAnalyticsPodfileGoogleAppMeasurementOnDeviceConversion (
5455 config . modResults . contents ,
0 commit comments