codeplay-common 4.1.8 → 4.2.0

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/.gitattributes CHANGED
@@ -1,2 +1,2 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Merbin Joe
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Merbin Joe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,86 +1,94 @@
1
- # codeplay-common
2
- Everything automatted in Capacitor apps, easy to maintain many apps in capacitor. It will reduce your 40% of work, with common file code.
3
-
4
-
5
- Easy add splashscreen and set animation
6
- Admob id automatically from capacitor.config.json file
7
- Make three build file for different store as per our requirement
8
- Based on store install various IAP plugins
9
- Make it to ionic project
10
-
11
- Donate to get full code including many common functions
12
- https://ko-fi.com/codeplay
13
-
14
- Version 4.1.8
15
- "consentDebug: false" is added
16
-
17
- Version 4.1.7
18
- admob configuration automatically added.
19
-
20
- Version 4.1.6
21
- "setup-baseline-profile.js" modification, duplicate validation error fixed
22
-
23
- Version 4.1.5
24
- While isTesting is true it is not validated from our new configuration admob file, now it is solved
25
-
26
- Version 4.1.4
27
- hardcoded version is removed for the admob-emi-nextgen
28
-
29
-
30
- Version 4.1.3
31
- "consentDebug": false automatically adds if not
32
-
33
- Version 4.1.2
34
- Speedup
35
-
36
- Version 4.1.1
37
- Auto admob integration updated
38
-
39
-
40
- version 4.0.9
41
- packageJson.scripts["ionic:serve"] = "cross-env NODE_ENV=development vite"; this line updated in "sync-files.js"
42
-
43
-
44
- version 4.0.8
45
- safearea plugin is checked and removed automatically
46
- Automatically added following in capacitor.config.json file
47
- "SystemBars": {
48
- "insetsHandling": "css"
49
- }
50
- patchFile() method is removed
51
-
52
-
53
-
54
-
55
- Version 4.0.6
56
- IAP related some automatic variable creation and validation
57
- Fetch from vite.config.json file
58
- 'import.meta.env.VITE_APP_UNIQUE_ID': JSON.stringify(APP_UNIQUE_ID),
59
- 'import.meta.env.VITE_ANDROID_ANALYTICS_ENABLED': JSON.stringify(ANDROID_ANALYTICS_ENABLED),
60
- 'import.meta.env.VITE_IOS_ANALYTICS_ENABLED': JSON.stringify(IOS_ANALYTICS_ENABLED),
61
- 'import.meta.env.VITE_IAP_DESIGN': JSON.stringify(IAP_DESIGN),
62
-
63
-
64
- Version 4.0.5
65
- In "files\buildCodeplay\packageidBaseModification-1.4.js" SCHEDULE_EXACT_ALARM permission added for the app unique id 2 (resume generator app)
66
-
67
-
68
- Version 4.0.4
69
- patchFile(); method is disabled, Due to "@capacitor/android:8.4.2" this update. I think it is realted to safearea issue fixed in this latest version, file in "SystemBars.java"
70
-
71
- Version 4.0.3
72
- Old admob check performs through plugin location, but not it is validated from capacitor.config.json
73
-
74
-
75
- Version: 4.0.2
76
- After check & install/download the latest version, the re-check is cancelled now
77
-
78
- Version: 4.0.1
79
- Base profile script added
80
-
81
-
82
- "version": "",
83
- Version : 4.0.0 (Previous version 3.2.19)
84
- 1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
85
- 2) Removed "modify-plugin-xml.js"
86
- 3)
1
+ # codeplay-common
2
+ Everything automatted in Capacitor apps, easy to maintain many apps in capacitor. It will reduce your 40% of work, with common file code.
3
+
4
+
5
+ Easy add splashscreen and set animation
6
+ Admob id automatically from capacitor.config.json file
7
+ Make three build file for different store as per our requirement
8
+ Based on store install various IAP plugins
9
+ Make it to ionic project
10
+
11
+ Donate to get full code including many common functions
12
+ https://ko-fi.com/codeplay
13
+
14
+
15
+
16
+ Version 4.2.0
17
+ Firebase related automatic changes updated
18
+
19
+ Version 4.1.9
20
+ Added AdMob nextgen 1.7 validation/default support for "overlappingHeight", "bannerTypeAndroidLandscape", and "bannerTypeiOSLandscape".
21
+
22
+ Version 4.1.8
23
+ "consentDebug: false" is added
24
+
25
+ Version 4.1.7
26
+ admob configuration automatically added.
27
+
28
+ Version 4.1.6
29
+ "setup-baseline-profile.js" modification, duplicate validation error fixed
30
+
31
+ Version 4.1.5
32
+ While isTesting is true it is not validated from our new configuration admob file, now it is solved
33
+
34
+ Version 4.1.4
35
+ hardcoded version is removed for the admob-emi-nextgen
36
+
37
+
38
+ Version 4.1.3
39
+ "consentDebug": false automatically adds if not
40
+
41
+ Version 4.1.2
42
+ Speedup
43
+
44
+ Version 4.1.1
45
+ Auto admob integration updated
46
+
47
+
48
+ version 4.0.9
49
+ packageJson.scripts["ionic:serve"] = "cross-env NODE_ENV=development vite"; this line updated in "sync-files.js"
50
+
51
+
52
+ version 4.0.8
53
+ safearea plugin is checked and removed automatically
54
+ Automatically added following in capacitor.config.json file
55
+ "SystemBars": {
56
+ "insetsHandling": "css"
57
+ }
58
+ patchFile() method is removed
59
+
60
+
61
+
62
+
63
+ Version 4.0.6
64
+ IAP related some automatic variable creation and validation
65
+ Fetch from vite.config.json file
66
+ 'import.meta.env.VITE_APP_UNIQUE_ID': JSON.stringify(APP_UNIQUE_ID),
67
+ 'import.meta.env.VITE_ANDROID_ANALYTICS_ENABLED': JSON.stringify(ANDROID_ANALYTICS_ENABLED),
68
+ 'import.meta.env.VITE_IOS_ANALYTICS_ENABLED': JSON.stringify(IOS_ANALYTICS_ENABLED),
69
+ 'import.meta.env.VITE_IAP_DESIGN': JSON.stringify(IAP_DESIGN),
70
+
71
+
72
+ Version 4.0.5
73
+ In "files\buildCodeplay\packageidBaseModification-1.4.js" SCHEDULE_EXACT_ALARM permission added for the app unique id 2 (resume generator app)
74
+
75
+
76
+ Version 4.0.4
77
+ patchFile(); method is disabled, Due to "@capacitor/android:8.4.2" this update. I think it is realted to safearea issue fixed in this latest version, file in "SystemBars.java"
78
+
79
+ Version 4.0.3
80
+ Old admob check performs through plugin location, but not it is validated from capacitor.config.json
81
+
82
+
83
+ Version: 4.0.2
84
+ After check & install/download the latest version, the re-check is cancelled now
85
+
86
+ Version: 4.0.1
87
+ Base profile script added
88
+
89
+
90
+ "version": "",
91
+ Version : 4.0.0 (Previous version 3.2.19)
92
+ 1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
93
+ 2) Removed "modify-plugin-xml.js"
94
+ 3)
@@ -2760,8 +2760,11 @@ const ADMOB_NEXTGEN_DEFAULTS = {
2760
2760
  collapsibleEnabled: "",
2761
2761
  isLandScape: "",
2762
2762
  isOverlappingEnable: "",
2763
+ overlappingHeight: "",
2763
2764
  bannerTypeAndroid: "",
2765
+ bannerTypeAndroidLandscape: "",
2764
2766
  bannerTypeiOS: "",
2767
+ bannerTypeiOSLandscape: "",
2765
2768
  bannerTopSpaceColor: "",
2766
2769
  interstitialLoadScreenTextColor: "",
2767
2770
  interstitialLoadScreenBackgroundColor: "",
@@ -2865,7 +2868,6 @@ const ensureAdmobNextgenConfigDefaults = (config) => {
2865
2868
  const runtimeConfig = hasObjectKeys(config?.config) ? config.config : {};
2866
2869
 
2867
2870
  normalizedConfig.config = mergeObjects(ADMOB_NEXTGEN_DEFAULTS.config, runtimeConfig);
2868
- delete normalizedConfig.config.overlappingHeight;
2869
2871
 
2870
2872
  return normalizedConfig;
2871
2873
  };
@@ -3127,6 +3129,57 @@ const trackEvent = async (name, params = {}) => {
3127
3129
  }
3128
3130
  };
3129
3131
 
3132
+ const normalizeCurrency = (currency) => {
3133
+ if (typeof currency !== 'string') return '';
3134
+ return currency.trim().toUpperCase();
3135
+ };
3136
+
3137
+ const buildPurchaseParams = (params = {}) => {
3138
+ const value = Number(params.value || 0);
3139
+ const itemId = params.item_id || params.itemId || '';
3140
+ const itemName = params.item_name || params.itemName || itemId || params.store || 'purchase';
3141
+ const quantity = Number(params.quantity || 1);
3142
+ const transactionId = params.transaction_id || params.transactionId || \`\${params.store || 'store'}_\${itemId || itemName || 'purchase'}\`;
3143
+
3144
+ return cleanParams({
3145
+ transaction_id: transactionId,
3146
+ currency: normalizeCurrency(params.currency),
3147
+ value,
3148
+ items: [
3149
+ cleanParams({
3150
+ item_id: itemId,
3151
+ item_name: itemName,
3152
+ item_category: params.store || '',
3153
+ price: value,
3154
+ quantity,
3155
+ subscription_period: params.subscription_period || '',
3156
+ }),
3157
+ ],
3158
+ });
3159
+ };
3160
+
3161
+ const buildAdRevenueParams = (params = {}) => {
3162
+ const value = Number(params.value || 0);
3163
+
3164
+ return cleanParams({
3165
+ ad_platform: params.ad_platform || 'AdMob',
3166
+ ad_source: params.ad_source || 'AdMob',
3167
+ ad_unit_name: params.ad_unit_name || params.adUnitId || '',
3168
+ ad_format: params.ad_format || '',
3169
+ currency: normalizeCurrency(params.currency),
3170
+ value,
3171
+ });
3172
+ };
3173
+
3174
+ const trackMonetizationEvent = async (customEventName, params = {}) => {
3175
+ await trackEvent(customEventName, params);
3176
+ await trackEvent('purchase', buildPurchaseParams(params));
3177
+ };
3178
+
3179
+ export const trackAdRevenue = (params) => {
3180
+ trackEvent('ad_impression', buildAdRevenueParams(params));
3181
+ };
3182
+
3130
3183
  export const trackSubscriptionScreenViewed = (params) => {
3131
3184
  trackEvent('subscription_screen_view', params);
3132
3185
  };
@@ -3136,16 +3189,17 @@ export const trackSubscriptionCheckoutStarted = (params) => {
3136
3189
  };
3137
3190
 
3138
3191
  export const trackSubscriptionPurchased = (params) => {
3139
- trackEvent('subscription_purchase', params);
3192
+ trackMonetizationEvent('subscription_purchase', params);
3140
3193
  };
3141
3194
 
3142
3195
  export const trackConsumablePurchased = (params) => {
3143
- trackEvent('consumable_purchase', params);
3196
+ trackMonetizationEvent('consumable_purchase', params);
3144
3197
  };
3145
3198
  `;
3146
3199
 
3147
3200
  const noopWrapper = `const trackEvent = () => {};
3148
3201
 
3202
+ export const trackAdRevenue = trackEvent;
3149
3203
  export const trackSubscriptionScreenViewed = trackEvent;
3150
3204
  export const trackSubscriptionCheckoutStarted = trackEvent;
3151
3205
  export const trackSubscriptionPurchased = trackEvent;
@@ -3624,8 +3678,11 @@ const REQUIRED_CONFIG_KEYS = [
3624
3678
  "collapsibleEnabled",
3625
3679
  "isLandScape",
3626
3680
  "isOverlappingEnable",
3681
+ "overlappingHeight",
3627
3682
  "bannerTypeAndroid",
3683
+ "bannerTypeAndroidLandscape",
3628
3684
  "bannerTypeiOS",
3685
+ "bannerTypeiOSLandscape",
3629
3686
  "bannerTopSpaceColor",
3630
3687
  "interstitialLoadScreenTextColor",
3631
3688
  "interstitialLoadScreenBackgroundColor",
@@ -1,27 +1,27 @@
1
- {
2
- "plugins":[
3
- {"name":"backbutton","pattern":"backbutton-(\\d+\\.\\d+)\\.js$","minVersion":"2.1","baseDir":"js","mandatoryUpdate":true},
1
+ {
2
+ "plugins":[
3
+ {"name":"backbutton","pattern":"backbutton-(\\d+\\.\\d+)\\.js$","minVersion":"2.1","baseDir":"js","mandatoryUpdate":true},
4
4
  {"name":"common-js","pattern":"common-(\\d+\\.\\d+)(?:-beta-(\\d+))?\\.js$","minVersion":"6.7","baseDir":"js","mandatoryUpdate":true},
5
-
5
+
6
6
  {"name":"admob-emi-nextgen","pattern":"Ads[\\\\/]admob-emi-nextgen-(\\d+\\.\\d+)\\.js$","minVersion":"1.0","baseDir":"js","mandatoryUpdate":true},
7
- {"name":"video-player","pattern":"video-player-(\\d+\\.\\d+)\\.js$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true},
8
- {"name":"image-cropper","pattern":"image-cropper-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
9
- {"name":"beautify","pattern":"beautify-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
10
-
11
-
12
- {"name":"localization","pattern":"localization-(\\d+\\.\\d+)$","minVersion":"1.8","baseDir":"js/localization","mandatoryUpdate":true,"isFolder":true},
13
- {"name": "localization_settings","pattern": "localization_settings-(\\d+\\.\\d+)\\.js$","minVersion": "1.1","required": true,"baseDir": "js/localization","mandatoryUpdate": true},
14
-
15
-
16
- {"name":"editor","pattern":"editor-(\\d+\\.\\d+)$","minVersion":"2.0","baseDir":"js/editor","mandatoryUpdate":true,"isFolder":true},
17
- {"name":"ffmpeg","pattern":"ffmpeg-(\\d+\\.\\d+)$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true,"isFolder":true},
18
- {"name":"theme","pattern":"theme-(\\d+\\.\\d+)$","minVersion":"3.5","baseDir":"theme","destDir":"theme","mandatoryUpdate":true,"isFolder":true},
19
- {"name":"certificatejs","pattern":"certificatejs-(\\d+\\.\\d+)$","minVersion":"1.9","baseDir":"certificate","destDir":"certificate","mandatoryUpdate":true,"isFolder":true},
7
+ {"name":"video-player","pattern":"video-player-(\\d+\\.\\d+)\\.js$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true},
8
+ {"name":"image-cropper","pattern":"image-cropper-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
9
+ {"name":"beautify","pattern":"beautify-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
10
+
11
+
12
+ {"name":"localization","pattern":"localization-(\\d+\\.\\d+)$","minVersion":"1.8","baseDir":"js/localization","mandatoryUpdate":true,"isFolder":true},
13
+ {"name": "localization_settings","pattern": "localization_settings-(\\d+\\.\\d+)\\.js$","minVersion": "1.1","required": true,"baseDir": "js/localization","mandatoryUpdate": true},
14
+
15
+
16
+ {"name":"editor","pattern":"editor-(\\d+\\.\\d+)$","minVersion":"2.0","baseDir":"js/editor","mandatoryUpdate":true,"isFolder":true},
17
+ {"name":"ffmpeg","pattern":"ffmpeg-(\\d+\\.\\d+)$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true,"isFolder":true},
18
+ {"name":"theme","pattern":"theme-(\\d+\\.\\d+)$","minVersion":"3.5","baseDir":"theme","destDir":"theme","mandatoryUpdate":true,"isFolder":true},
19
+ {"name":"certificatejs","pattern":"certificatejs-(\\d+\\.\\d+)$","minVersion":"1.9","baseDir":"certificate","destDir":"certificate","mandatoryUpdate":true,"isFolder":true},
20
20
  {"name":"IAP","pattern":"IAP-(\\d+\\.\\d+)$","minVersion":"3.6","baseDir":"js/Ads","mandatoryUpdate":true,"isFolder":true},
21
- {"name":"common-less","pattern":"common-(\\d+\\.\\d+)\\.less$","minVersion":"1.8","baseDir":"assets/css","mandatoryUpdate":true},
22
- {"name":"localNotification_AppSettings","pattern":"localNotification_AppSettings-(\\d+\\.\\d+)\\.js$","minVersion":"1.0","baseDir":"js","mandatoryUpdate":true},
23
- {"name":"localNotification","pattern":"localNotification-(\\d+\\.\\d+)\\.js$","minVersion":"2.2","baseDir":"js","mandatoryUpdate":true},
24
- {"name":"onesignal","pattern":"onesignal-(\\d+\\.\\d+)\\.js$","minVersion":"2.4","baseDir":"js","mandatoryUpdate":true},
25
- {"name":"saveToGalleryAndSaveAnyFile","pattern":"saveToGalleryAndSaveAnyFile-(\\d+\\.\\d+)(-ios)?\\.js$","minVersion":"3.1","baseDir":"js","mandatoryUpdate":true}
26
- ]
21
+ {"name":"common-less","pattern":"common-(\\d+\\.\\d+)\\.less$","minVersion":"1.8","baseDir":"assets/css","mandatoryUpdate":true},
22
+ {"name":"localNotification_AppSettings","pattern":"localNotification_AppSettings-(\\d+\\.\\d+)\\.js$","minVersion":"1.0","baseDir":"js","mandatoryUpdate":true},
23
+ {"name":"localNotification","pattern":"localNotification-(\\d+\\.\\d+)\\.js$","minVersion":"2.2","baseDir":"js","mandatoryUpdate":true},
24
+ {"name":"onesignal","pattern":"onesignal-(\\d+\\.\\d+)\\.js$","minVersion":"2.4","baseDir":"js","mandatoryUpdate":true},
25
+ {"name":"saveToGalleryAndSaveAnyFile","pattern":"saveToGalleryAndSaveAnyFile-(\\d+\\.\\d+)(-ios)?\\.js$","minVersion":"3.1","baseDir":"js","mandatoryUpdate":true}
26
+ ]
27
27
  }