Skip to content

Commit a05ec6b

Browse files
committed
Update gradle properties modification
1 parent f47d4b1 commit a05ec6b

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

expo/withAppsFlyerAndroid.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
module.exports = function withAppsFlyerAndroid(config, {
2-
shouldUsePurchaseConnector = false
3-
} = {}) {
2+
shouldUsePurchaseConnector = false
3+
} = {}) {
44

5-
if (shouldUsePurchaseConnector) {
6-
if (!config.android) {
7-
config.android = {};
8-
}
9-
10-
if (!config.android.gradleProperties) {
11-
config.android.gradleProperties = {};
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({
18+
key: 'appsflyer.enable_purchase_connector',
19+
value: 'true',
20+
});
21+
}
1222
}
13-
14-
// Enable AppsFlyer Purchase Connector for Android
15-
config.android.gradleProperties['appsflyer.enable_purchase_connector'] = 'true';
16-
}
1723

1824
return config;
1925
};

0 commit comments

Comments
 (0)