codeplay-common 2.0.9 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -820,6 +820,7 @@ function updateInfoPlist(admobConfig) {
|
|
|
820
820
|
console.log('AdMob IDs and additional configurations successfully updated in Info.plist');
|
|
821
821
|
}
|
|
822
822
|
|
|
823
|
+
let _admobConfig;
|
|
823
824
|
try {
|
|
824
825
|
if (!fileExists(configPath)) {
|
|
825
826
|
throw new Error(' ❌ capacitor.config.json not found. Skipping setup.');
|
|
@@ -833,20 +834,20 @@ try {
|
|
|
833
834
|
|
|
834
835
|
|
|
835
836
|
|
|
836
|
-
|
|
837
|
+
_admobConfig = getAdMobConfig();
|
|
837
838
|
|
|
838
839
|
|
|
839
840
|
|
|
840
841
|
|
|
841
842
|
|
|
842
843
|
// Proceed only if ADMOB_ENABLED is true
|
|
843
|
-
if (
|
|
844
|
+
if (_admobConfig.ADMOB_ENABLED) {
|
|
844
845
|
if (fileExists(androidPlatformPath)) {
|
|
845
|
-
updatePluginXml(
|
|
846
|
+
updatePluginXml(_admobConfig);
|
|
846
847
|
}
|
|
847
848
|
|
|
848
849
|
if (fileExists(iosPlatformPath)) {
|
|
849
|
-
updateInfoPlist(
|
|
850
|
+
updateInfoPlist(_admobConfig);
|
|
850
851
|
}
|
|
851
852
|
}
|
|
852
853
|
|
|
@@ -1087,7 +1088,7 @@ const admobConfigPath = path.join('src', 'js','Ads', 'admob-ad-configuration.jso
|
|
|
1087
1088
|
const checkAdmobConfigurationProperty=()=>{
|
|
1088
1089
|
|
|
1089
1090
|
|
|
1090
|
-
if (
|
|
1091
|
+
if (_admobConfig.ADMOB_ENABLED)
|
|
1091
1092
|
{
|
|
1092
1093
|
console.log("ℹ️ Admob is not enabled so 'admob-ad-configuration.json' checking is skipping...");
|
|
1093
1094
|
return;
|
|
@@ -1129,17 +1130,17 @@ const REQUIRED_CONFIG_KEYS = [
|
|
|
1129
1130
|
|
|
1130
1131
|
|
|
1131
1132
|
|
|
1132
|
-
let
|
|
1133
|
+
let admobConfigInJson;
|
|
1133
1134
|
|
|
1134
1135
|
try {
|
|
1135
|
-
|
|
1136
|
+
admobConfigInJson = JSON.parse(readFileSync(admobConfigPath, "utf8"));
|
|
1136
1137
|
} catch (err) {
|
|
1137
1138
|
console.error("❌ Failed to read admob-ad-configuration.json", err);
|
|
1138
1139
|
process.exit(1);
|
|
1139
1140
|
}
|
|
1140
1141
|
|
|
1141
1142
|
// ✅ Validate config object exists
|
|
1142
|
-
if (!
|
|
1143
|
+
if (!admobConfigInJson.config) {
|
|
1143
1144
|
console.error('❌ "config" object is missing in admob-ad-configuration.json');
|
|
1144
1145
|
process.exit(1);
|
|
1145
1146
|
}
|
|
@@ -1147,13 +1148,13 @@ const REQUIRED_CONFIG_KEYS = [
|
|
|
1147
1148
|
|
|
1148
1149
|
const admobConfigMinVersion="1.4"
|
|
1149
1150
|
|
|
1150
|
-
if (compareVersion(
|
|
1151
|
+
if (compareVersion(admobConfigInJson.VERSION, admobConfigMinVersion) < 0) {
|
|
1151
1152
|
console.error(`❌ Please use at-least version ${admobConfigMinVersion} in "src/js/Ads/admob-ad-configuration.json"`);
|
|
1152
1153
|
process.exit(1);
|
|
1153
1154
|
}
|
|
1154
1155
|
|
|
1155
1156
|
|
|
1156
|
-
const config =
|
|
1157
|
+
const config = admobConfigInJson.config;
|
|
1157
1158
|
|
|
1158
1159
|
// ✅ Find missing properties
|
|
1159
1160
|
const missingKeys = REQUIRED_CONFIG_KEYS.filter(
|