codeplay-common 4.1.9 → 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,89 +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.9
15
- Added AdMob nextgen validation/default support for "overlappingHeight", "bannerTypeAndroidLandscape", and "bannerTypeiOSLandscape".
16
-
17
- Version 4.1.8
18
- "consentDebug: false" is added
19
-
20
- Version 4.1.7
21
- admob configuration automatically added.
22
-
23
- Version 4.1.6
24
- "setup-baseline-profile.js" modification, duplicate validation error fixed
25
-
26
- Version 4.1.5
27
- While isTesting is true it is not validated from our new configuration admob file, now it is solved
28
-
29
- Version 4.1.4
30
- hardcoded version is removed for the admob-emi-nextgen
31
-
32
-
33
- Version 4.1.3
34
- "consentDebug": false automatically adds if not
35
-
36
- Version 4.1.2
37
- Speedup
38
-
39
- Version 4.1.1
40
- Auto admob integration updated
41
-
42
-
43
- version 4.0.9
44
- packageJson.scripts["ionic:serve"] = "cross-env NODE_ENV=development vite"; this line updated in "sync-files.js"
45
-
46
-
47
- version 4.0.8
48
- safearea plugin is checked and removed automatically
49
- Automatically added following in capacitor.config.json file
50
- "SystemBars": {
51
- "insetsHandling": "css"
52
- }
53
- patchFile() method is removed
54
-
55
-
56
-
57
-
58
- Version 4.0.6
59
- IAP related some automatic variable creation and validation
60
- Fetch from vite.config.json file
61
- 'import.meta.env.VITE_APP_UNIQUE_ID': JSON.stringify(APP_UNIQUE_ID),
62
- 'import.meta.env.VITE_ANDROID_ANALYTICS_ENABLED': JSON.stringify(ANDROID_ANALYTICS_ENABLED),
63
- 'import.meta.env.VITE_IOS_ANALYTICS_ENABLED': JSON.stringify(IOS_ANALYTICS_ENABLED),
64
- 'import.meta.env.VITE_IAP_DESIGN': JSON.stringify(IAP_DESIGN),
65
-
66
-
67
- Version 4.0.5
68
- In "files\buildCodeplay\packageidBaseModification-1.4.js" SCHEDULE_EXACT_ALARM permission added for the app unique id 2 (resume generator app)
69
-
70
-
71
- Version 4.0.4
72
- 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"
73
-
74
- Version 4.0.3
75
- Old admob check performs through plugin location, but not it is validated from capacitor.config.json
76
-
77
-
78
- Version: 4.0.2
79
- After check & install/download the latest version, the re-check is cancelled now
80
-
81
- Version: 4.0.1
82
- Base profile script added
83
-
84
-
85
- "version": "",
86
- Version : 4.0.0 (Previous version 3.2.19)
87
- 1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
88
- 2) Removed "modify-plugin-xml.js"
89
- 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)
@@ -3129,6 +3129,57 @@ const trackEvent = async (name, params = {}) => {
3129
3129
  }
3130
3130
  };
3131
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
+
3132
3183
  export const trackSubscriptionScreenViewed = (params) => {
3133
3184
  trackEvent('subscription_screen_view', params);
3134
3185
  };
@@ -3138,16 +3189,17 @@ export const trackSubscriptionCheckoutStarted = (params) => {
3138
3189
  };
3139
3190
 
3140
3191
  export const trackSubscriptionPurchased = (params) => {
3141
- trackEvent('subscription_purchase', params);
3192
+ trackMonetizationEvent('subscription_purchase', params);
3142
3193
  };
3143
3194
 
3144
3195
  export const trackConsumablePurchased = (params) => {
3145
- trackEvent('consumable_purchase', params);
3196
+ trackMonetizationEvent('consumable_purchase', params);
3146
3197
  };
3147
3198
  `;
3148
3199
 
3149
3200
  const noopWrapper = `const trackEvent = () => {};
3150
3201
 
3202
+ export const trackAdRevenue = trackEvent;
3151
3203
  export const trackSubscriptionScreenViewed = trackEvent;
3152
3204
  export const trackSubscriptionCheckoutStarted = trackEvent;
3153
3205
  export const trackSubscriptionPurchased = trackEvent;
@@ -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
  }