File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ const { withGradleProperties } = require ( '@expo/config-plugins' ) ;
2+
13module . exports = function withAppsFlyerAndroid ( config , {
2- shouldUsePurchaseConnector = false
3- } = { } ) {
4-
5- if ( shouldUsePurchaseConnector ) {
6- if ( ! config . android ) {
7- config . android = { } ;
8- }
9-
10- if ( ! config . android . gradleProperties ) {
11- config . android . gradleProperties = [ ] ;
12- }
13-
14- // Prevent duplicates
15- const existingKeys = config . android . gradleProperties . map ( p => p . key ) ;
16- if ( ! existingKeys . includes ( 'appsflyer.enable_purchase_connector' ) ) {
17- config . android . gradleProperties . push ( {
4+ shouldUsePurchaseConnector = false
5+ } = { } ) {
6+
7+ if ( shouldUsePurchaseConnector ) {
8+ config = withGradleProperties ( config , config => {
9+ const props = config . modResults ;
10+
11+ const alreadySet = props . some ( p => p . key === 'appsflyer.enable_purchase_connector' ) ;
12+ if ( ! alreadySet ) {
13+ props . push ( {
1814 key : 'appsflyer.enable_purchase_connector' ,
1915 value : 'true' ,
2016 } ) ;
2117 }
22- }
23-
18+
19+ return config ;
20+ } ) ;
21+ }
22+
2423 return config ;
25- } ;
24+ } ;
You can’t perform that action at this time.
0 commit comments