cordova-plugin-hot-updates 2.1.1 → 2.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "cordova-plugin-hot-updates",
3
- "version": "2.1.1",
4
- "description": "Cordova plugin for frontend-controlled over-the-air (OTA) hot updates using WebView Reload approach. Enables seamless web content updates without requiring App Store approval.",
3
+ "version": "2.2.0",
4
+ "description": "Frontend-controlled manual hot updates for Cordova iOS apps using WebView Reload approach. Manual updates only, JavaScript controls all decisions.",
5
5
  "main": "www/HotUpdates.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
8
  "prepublishOnly": "npm run verify",
9
- "verify": "node -e \"console.log('Verifying package structure...'); const fs = require('fs'); ['www/HotUpdates.js', 'src/ios/HotUpdates.h', 'src/ios/HotUpdates.m', 'plugin.xml', 'LICENSE', 'README.md'].forEach(f => { if (!fs.existsSync(f)) throw new Error('Missing required file: ' + f); }); console.log('✓ All required files present');\"",
9
+ "verify": "node -e \"console.log('Verifying package structure...'); const fs = require('fs'); ['www/HotUpdates.js', 'src/ios/HotUpdates.h', 'src/ios/HotUpdates.m', 'src/ios/HotUpdatesConstants.h', 'src/ios/HotUpdatesConstants.m', 'src/ios/HotUpdates+Helpers.h', 'src/ios/HotUpdates+Helpers.m', 'plugin.xml', 'LICENSE', 'README.md'].forEach(f => { if (!fs.existsSync(f)) throw new Error('Missing required file: ' + f); }); console.log('✓ All required files present');\"",
10
10
  "pack-test": "npm pack && echo '\n✓ Package created. Test installation with: cordova plugin add ./cordova-plugin-hot-updates-*.tgz'",
11
11
  "preversion": "npm run verify",
12
12
  "postversion": "git push && git push --tags"
@@ -23,6 +23,7 @@
23
23
  "over-the-air",
24
24
  "webview",
25
25
  "reload",
26
+ "manual",
26
27
  "ecosystem:cordova",
27
28
  "cordova-ios",
28
29
  "mobile",
@@ -58,10 +59,8 @@
58
59
  "www/",
59
60
  "src/",
60
61
  "scripts/",
61
- "docs/",
62
62
  "plugin.xml",
63
63
  "README.md",
64
- "LICENSE",
65
- "CHANGELOG.md"
64
+ "LICENSE"
66
65
  ]
67
66
  }
package/plugin.xml CHANGED
@@ -1,16 +1,17 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
2
  <plugin id="cordova-plugin-hot-updates"
3
- version="1.0.0"
3
+ version="2.2.0"
4
4
  xmlns="http://apache.org/cordova/ns/plugins/1.0"
5
5
  xmlns:android="http://schemas.android.com/apk/res/android">
6
6
 
7
7
  <name>Cordova Hot Updates Plugin</name>
8
8
  <description>
9
- Cordova plugin for automatic over-the-air (OTA) hot updates using WebView Reload approach.
9
+ Cordova plugin for frontend-controlled manual hot updates using WebView Reload approach.
10
+ Manual updates only, JavaScript controls all decisions.
10
11
  Enables seamless web content updates without requiring App Store approval.
11
12
  </description>
12
13
  <license>Custom Non-Commercial</license>
13
- <keywords>cordova,hot,updates,ota,over-the-air,webview,reload</keywords>
14
+ <keywords>cordova,hot,updates,ota,over-the-air,webview,reload,manual</keywords>
14
15
  <repo>https://github.com/vladimirDarksy/Cordova_hot_update.git</repo>
15
16
  <issue>https://github.com/vladimirDarksy/Cordova_hot_update/issues</issue>
16
17
 
@@ -23,7 +24,7 @@
23
24
 
24
25
  <!-- JavaScript interface -->
25
26
  <js-module src="www/HotUpdates.js" name="HotUpdates">
26
- <clobbers target="HotUpdates" />
27
+ <clobbers target="hotUpdate" />
27
28
  </js-module>
28
29
 
29
30
  <!-- iOS platform -->
@@ -39,6 +40,10 @@
39
40
  <!-- Native iOS files -->
40
41
  <source-file src="src/ios/HotUpdates.h" />
41
42
  <source-file src="src/ios/HotUpdates.m" />
43
+ <source-file src="src/ios/HotUpdatesConstants.h" />
44
+ <source-file src="src/ios/HotUpdatesConstants.m" />
45
+ <source-file src="src/ios/HotUpdates+Helpers.h" />
46
+ <source-file src="src/ios/HotUpdates+Helpers.m" />
42
47
 
43
48
  <!-- Required frameworks -->
44
49
  <framework src="Foundation.framework" />
@@ -62,12 +67,6 @@
62
67
  <true/>
63
68
  </dict>
64
69
  </edit-config>
65
-
66
- <!-- Configuration preferences with default values -->
67
- <preference name="hot_updates_server_url" default="https://your-server.com/api/updates" />
68
- <preference name="hot_updates_check_interval" default="300000" />
69
- <preference name="hot_updates_auto_download" default="true" />
70
- <preference name="hot_updates_auto_install" default="true" />
71
70
  </platform>
72
71
 
73
72
  <!-- Android platform (placeholder for future implementation) -->
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * @file HotUpdates+Helpers.h
3
+ * @brief Helper methods for Hot Updates Plugin
4
+ * @details Category extension providing utility methods for error handling
5
+ * @version 2.2.0
6
+ * @date 2025-11-13
7
+ * @author Mustafin Vladimir
8
+ * @copyright Copyright (c) 2025. All rights reserved.
9
+ */
10
+
11
+ #import "HotUpdates.h"
12
+
13
+ @interface HotUpdates (Helpers)
14
+
15
+ /*!
16
+ * @brief Create error dictionary for JavaScript callback
17
+ * @param code Error code (e.g., "URL_REQUIRED")
18
+ * @param message Detailed message for logs
19
+ * @return Dictionary with error structure {error: {code: "...", message: "..."}}
20
+ */
21
+ - (NSDictionary*)createError:(NSString*)code message:(NSString*)message;
22
+
23
+ @end
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * @file HotUpdates+Helpers.m
3
+ * @brief Implementation of helper methods for Hot Updates Plugin
4
+ * @details Provides utility methods for error handling and response formatting
5
+ * @version 2.2.0
6
+ * @date 2025-11-13
7
+ * @author Mustafin Vladimir
8
+ * @copyright Copyright (c) 2025. All rights reserved.
9
+ */
10
+
11
+ #import "HotUpdates+Helpers.h"
12
+
13
+ @implementation HotUpdates (Helpers)
14
+
15
+ - (NSDictionary*)createError:(NSString*)code message:(NSString*)message {
16
+ return @{
17
+ @"error": @{
18
+ @"code": code,
19
+ @"message": message
20
+ }
21
+ };
22
+ }
23
+
24
+ @end
@@ -19,6 +19,8 @@
19
19
 
20
20
  #import <UIKit/UIKit.h>
21
21
  #import <Cordova/CDVPlugin.h>
22
+ #import "HotUpdatesConstants.h"
23
+
22
24
  @interface HotUpdates : CDVPlugin
23
25
  {
24
26
  NSString *documentsPath;
@@ -61,9 +63,8 @@
61
63
  - (void)getUpdate:(CDVInvokedUrlCommand*)command; // Download update
62
64
  - (void)forceUpdate:(CDVInvokedUrlCommand*)command; // Install downloaded update
63
65
  - (void)canary:(CDVInvokedUrlCommand*)command; // Confirm successful load
64
- - (void)rollback:(CDVInvokedUrlCommand*)command; // Rollback to previous version
65
66
 
66
- // Information methods
67
- - (void)getVersionInfo:(CDVInvokedUrlCommand*)command;
67
+ // Debug methods
68
+ - (void)getVersionInfo:(CDVInvokedUrlCommand*)command; // Get all version info for debugging
68
69
 
69
70
  @end