Skip to content

Commit 47b88a1

Browse files
committed
Add BackupRules parameter to main Expo plugin + minimal logs
1 parent 069c641 commit 47b88a1

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

expo/withAppsFlyer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const withAppsFlyerIos = require('./withAppsFlyerIos');
22
const withAppsFlyerAndroid = require('./withAppsFlyerAndroid');
3-
console.log('[AppsFlyerPlugin] Main plugin loaded');
43

54
module.exports = function withAppsFlyer(config, {
65
shouldUseStrictMode = false,
7-
shouldUsePurchaseConnector = false
6+
shouldUsePurchaseConnector = false,
7+
preferAppsFlyerBackupRules = false
88
} = {}) {
99
config = withAppsFlyerIos(config, { shouldUseStrictMode, shouldUsePurchaseConnector });
10-
config = withAppsFlyerAndroid(config, { shouldUsePurchaseConnector });
10+
config = withAppsFlyerAndroid(config, { shouldUsePurchaseConnector, preferAppsFlyerBackupRules });
1111
return config;
12-
};
12+
};

expo/withAppsFlyerAndroid.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ function addPurchaseConnectorFlag(config) {
1616
// Opt-in backup rules handling
1717
function withCustomAndroidManifest(config, { preferAppsFlyerBackupRules = false } = {}) {
1818
return withAndroidManifest(config, async (cfg) => {
19-
console.log('[AppsFlyerPlugin] Starting Android manifest modifications...');
20-
2119
const androidManifest = cfg.modResults;
2220
const manifest = androidManifest.manifest;
2321

@@ -29,7 +27,6 @@ function withCustomAndroidManifest(config, { preferAppsFlyerBackupRules = false
2927
// Ensure xmlns:tools is present in the <manifest> tag
3028
if (!manifest.$['xmlns:tools']) {
3129
manifest.$['xmlns:tools'] = 'http://schemas.android.com/tools';
32-
console.log('[AppsFlyerPlugin] Added xmlns:tools namespace');
3330
}
3431

3532
const application = manifest.application[0];
@@ -59,24 +56,15 @@ function withCustomAndroidManifest(config, { preferAppsFlyerBackupRules = false
5956
// This allows AppsFlyer SDK's built-in backup rules to be used instead.
6057
if (hasDataExtractionRules) {
6158
delete appAttrs['android:dataExtractionRules'];
62-
console.log(
63-
'[AppsFlyerPlugin] Removed android:dataExtractionRules to use AppsFlyer SDK rules (preferAppsFlyerBackupRules=true)'
64-
);
59+
console.log('[AppsFlyerPlugin] Removed android:dataExtractionRules to use AppsFlyer SDK rules');
6560
}
6661

6762
if (hasFullBackupContent) {
6863
delete appAttrs['android:fullBackupContent'];
69-
console.log(
70-
'[AppsFlyerPlugin] Removed android:fullBackupContent to use AppsFlyer SDK rules (preferAppsFlyerBackupRules=true)'
71-
);
64+
console.log('[AppsFlyerPlugin] Removed android:fullBackupContent to use AppsFlyer SDK rules');
7265
}
73-
} else {
74-
console.log(
75-
'[AppsFlyerPlugin] App does not define backup attributes; no conflict with AppsFlyer SDK (preferAppsFlyerBackupRules=true)'
76-
);
7766
}
7867

79-
console.log('[AppsFlyerPlugin] Android manifest modifications completed');
8068
return cfg;
8169
});
8270
}

0 commit comments

Comments
 (0)