codeplay-common 4.1.7 → 4.1.9

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.
package/README.md CHANGED
@@ -11,6 +11,11 @@ Make it to ionic project
11
11
  Donate to get full code including many common functions
12
12
  https://ko-fi.com/codeplay
13
13
 
14
+ Version 4.1.9
15
+ Added AdMob nextgen validation/default support for "overlappingHeight", "bannerTypeAndroidLandscape", and "bannerTypeiOSLandscape".
16
+
17
+ Version 4.1.8
18
+ "consentDebug: false" is added
14
19
 
15
20
  Version 4.1.7
16
21
  admob configuration automatically added.
@@ -81,4 +86,4 @@ Version: 4.0.1
81
86
  Version : 4.0.0 (Previous version 3.2.19)
82
87
  1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
83
88
  2) Removed "modify-plugin-xml.js"
84
- 3)
89
+ 3)
@@ -2739,43 +2739,47 @@ const ADMOB_NEXTGEN_DEFAULTS = {
2739
2739
  VERSION: "1.6",
2740
2740
  ios: { nativeid: "" },
2741
2741
  android: { nativeid: "" },
2742
- config: {
2743
- bannerStartupDelayMs: "",
2744
- interstitialStartupDelayMs: "",
2745
- appOpenLoadOnColdStart: "",
2746
- appOpenStartupDelayMs: "",
2747
- useAndroidPreloadAds: true,
2748
- useAndroidBannerPreloadAds: false,
2749
- preloadBufferSize: 1,
2750
- isKidsApp: false,
2751
- isTesting: false,
2752
- consentDebug: false,
2753
- isConsoleLogEnabled: false,
2754
- bannerEnabled: true,
2755
- interstitialEnabled: true,
2756
- appOpenEnabled: true,
2757
- rewardVideoEnabled: false,
2758
- rewardInterstitialEnabled: false,
2759
- collapsibleEnabled: "",
2760
- isLandScape: "",
2761
- isOverlappingEnable: "",
2762
- bannerTypeAndroid: "",
2763
- bannerTypeiOS: "",
2764
- bannerTopSpaceColor: "",
2765
- interstitialLoadScreenTextColor: "",
2766
- interstitialLoadScreenBackgroundColor: "",
2767
- beforeBannerSpace: "",
2768
- whenShow: "",
2769
- minimumClick: "",
2770
- interstitialTimeOut: "",
2771
- interstitialFirstTimeOut: "",
2772
- appOpenAdsTimeOut: "",
2773
- maxRetryCount: "",
2774
- retrySecondsAr: "",
2775
- appOpenPerSession: "",
2776
- interstitialPerSession: "",
2777
- appOpenFirstTimeOut: ""
2778
- },
2742
+ config: {
2743
+ bannerStartupDelayMs: "",
2744
+ interstitialStartupDelayMs: "",
2745
+ appOpenLoadOnColdStart: "",
2746
+ appOpenStartupDelayMs: "",
2747
+ useAndroidPreloadAds: true,
2748
+ useAndroidBannerPreloadAds: false,
2749
+ preloadBufferSize: 1,
2750
+ consentDebug: false,
2751
+ isKidsApp: false,
2752
+ isTesting: false,
2753
+ consentDebug: false,
2754
+ isConsoleLogEnabled: false,
2755
+ bannerEnabled: true,
2756
+ interstitialEnabled: true,
2757
+ appOpenEnabled: true,
2758
+ rewardVideoEnabled: false,
2759
+ rewardInterstitialEnabled: false,
2760
+ collapsibleEnabled: "",
2761
+ isLandScape: "",
2762
+ isOverlappingEnable: "",
2763
+ overlappingHeight: "",
2764
+ bannerTypeAndroid: "",
2765
+ bannerTypeAndroidLandscape: "",
2766
+ bannerTypeiOS: "",
2767
+ bannerTypeiOSLandscape: "",
2768
+ bannerTopSpaceColor: "",
2769
+ interstitialLoadScreenTextColor: "",
2770
+ interstitialLoadScreenBackgroundColor: "",
2771
+ beforeBannerSpace: "",
2772
+ whenShow: "",
2773
+ minimumClick: "",
2774
+ interstitialTimeOut: "",
2775
+ interstitialFirstTimeOut: "",
2776
+ appOpenAdsTimeOut: "",
2777
+ maxRetryCount: "",
2778
+ retrySecondsAr: "",
2779
+ appOpenPerSession: "",
2780
+ interstitialPerSession: "",
2781
+ appOpenFirstTimeOut: ""
2782
+ },
2779
2783
  testid: {
2780
2784
  nativeid: "",
2781
2785
  nativeid_android: "ca-app-pub-3940256099942544/2247696110",
@@ -2855,22 +2859,21 @@ const mergeObjects = (template, source) => {
2855
2859
  return output;
2856
2860
  };
2857
2861
 
2858
- const hasObjectKeys = (value) => {
2859
- return value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0;
2860
- };
2861
-
2862
- const ensureAdmobNextgenConfigDefaults = (config) => {
2863
- const normalizedConfig = { ...config };
2864
- const runtimeConfig = hasObjectKeys(config?.config) ? config.config : {};
2865
-
2866
- normalizedConfig.config = mergeObjects(ADMOB_NEXTGEN_DEFAULTS.config, runtimeConfig);
2867
- delete normalizedConfig.config.overlappingHeight;
2868
-
2869
- return normalizedConfig;
2870
- };
2871
-
2872
- const buildNextgenAdmobConfigFromOldConfig = (templateConfig, existingNextgenConfig, oldConfig) => {
2873
- const mergedConfig = mergeObjects(templateConfig, mergeObjects(existingNextgenConfig, oldConfig));
2862
+ const hasObjectKeys = (value) => {
2863
+ return value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0;
2864
+ };
2865
+
2866
+ const ensureAdmobNextgenConfigDefaults = (config) => {
2867
+ const normalizedConfig = { ...config };
2868
+ const runtimeConfig = hasObjectKeys(config?.config) ? config.config : {};
2869
+
2870
+ normalizedConfig.config = mergeObjects(ADMOB_NEXTGEN_DEFAULTS.config, runtimeConfig);
2871
+
2872
+ return normalizedConfig;
2873
+ };
2874
+
2875
+ const buildNextgenAdmobConfigFromOldConfig = (templateConfig, existingNextgenConfig, oldConfig) => {
2876
+ const mergedConfig = mergeObjects(templateConfig, mergeObjects(existingNextgenConfig, oldConfig));
2874
2877
 
2875
2878
  if (hasObjectKeys(oldConfig)) {
2876
2879
  if (hasObjectKeys(oldConfig.ios)) {
@@ -2894,12 +2897,12 @@ const buildNextgenAdmobConfigFromOldConfig = (templateConfig, existingNextgenCon
2894
2897
  const existingRuntimeConfig = existingNextgenConfig.config || {};
2895
2898
  mergedConfig.config = mergeObjects(templateRuntimeConfig, mergeObjects(existingRuntimeConfig, oldConfig.config));
2896
2899
  }
2897
- }
2898
-
2899
- mergedConfig.VERSION = templateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
2900
-
2901
- return ensureAdmobNextgenConfigDefaults(mergedConfig);
2902
- };
2900
+ }
2901
+
2902
+ mergedConfig.VERSION = templateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
2903
+
2904
+ return ensureAdmobNextgenConfigDefaults(mergedConfig);
2905
+ };
2903
2906
 
2904
2907
  const syncAdmobNextgenPackage = () => {
2905
2908
  if (!fs.existsSync(packageJsonPath)) {
@@ -2995,16 +2998,16 @@ const ensureAdmobNextgenFiles = async () => {
2995
2998
  }
2996
2999
  }
2997
3000
 
2998
- let templateConfig = ADMOB_NEXTGEN_DEFAULTS;
2999
-
3000
- if (await downloadOptionalCodeplayFile(ADMOB_NEXTGEN_CONFIG, tempTemplatePath)) {
3001
- const downloadedTemplateConfig = JSON.parse(fs.readFileSync(tempTemplatePath, "utf8"));
3002
- templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, downloadedTemplateConfig);
3003
- templateConfig.VERSION = downloadedTemplateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
3004
- fs.unlinkSync(tempTemplatePath);
3005
- } else if (fs.existsSync(nextgenConfigPath)) {
3006
- templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, JSON.parse(fs.readFileSync(nextgenConfigPath, "utf8")));
3007
- }
3001
+ let templateConfig = ADMOB_NEXTGEN_DEFAULTS;
3002
+
3003
+ if (await downloadOptionalCodeplayFile(ADMOB_NEXTGEN_CONFIG, tempTemplatePath)) {
3004
+ const downloadedTemplateConfig = JSON.parse(fs.readFileSync(tempTemplatePath, "utf8"));
3005
+ templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, downloadedTemplateConfig);
3006
+ templateConfig.VERSION = downloadedTemplateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
3007
+ fs.unlinkSync(tempTemplatePath);
3008
+ } else if (fs.existsSync(nextgenConfigPath)) {
3009
+ templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, JSON.parse(fs.readFileSync(nextgenConfigPath, "utf8")));
3010
+ }
3008
3011
 
3009
3012
  const oldConfig = fs.existsSync(oldConfigPath)
3010
3013
  ? JSON.parse(fs.readFileSync(oldConfigPath, "utf8"))
@@ -3623,8 +3626,11 @@ const REQUIRED_CONFIG_KEYS = [
3623
3626
  "collapsibleEnabled",
3624
3627
  "isLandScape",
3625
3628
  "isOverlappingEnable",
3629
+ "overlappingHeight",
3626
3630
  "bannerTypeAndroid",
3631
+ "bannerTypeAndroidLandscape",
3627
3632
  "bannerTypeiOS",
3633
+ "bannerTypeiOSLandscape",
3628
3634
  "bannerTopSpaceColor",
3629
3635
  "interstitialLoadScreenTextColor",
3630
3636
  "interstitialLoadScreenBackgroundColor",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "4.1.7",
3
+ "version": "4.1.9",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",