native-update 3.1.1 → 3.1.3

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.
Files changed (203) hide show
  1. package/AI-INTEGRATION-GUIDE.md +98 -63
  2. package/Readme.md +89 -120
  3. package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +88 -12
  4. package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +45 -18
  5. package/cli/package.json +2 -2
  6. package/dist/esm/definitions.d.ts +8 -0
  7. package/dist/esm/plugin.js +16 -2
  8. package/dist/plugin.cjs.js +1 -1
  9. package/dist/plugin.esm.js +1 -1
  10. package/dist/plugin.js +2 -2
  11. package/docs/CHANGELOG.md +108 -0
  12. package/docs/KNOWN_LIMITATIONS.md +2 -2
  13. package/docs/MIGRATION.md +1 -1
  14. package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +64 -8
  15. package/ios/Plugin/NativeUpdatePlugin.swift +39 -13
  16. package/package.json +8 -3
  17. package/docs/AGENTS.md +0 -47
  18. package/docs/APP_REVIEW_GUIDE.md +0 -768
  19. package/docs/BUNDLE_SIGNING.md +0 -277
  20. package/docs/CLAUDE.md +0 -110
  21. package/docs/COMPREHENSIVE_AUDIT_REPORT.md +0 -526
  22. package/docs/DEPLOY_NOTES.md +0 -117
  23. package/docs/EXAMPLE_APPS_SIMPLIFICATION_PLAN.md +0 -384
  24. package/docs/EXAMPLE_APPS_SIMPLIFICATION_TRACKER.md +0 -390
  25. package/docs/LIVE_UPDATES_GUIDE.md +0 -675
  26. package/docs/MANUAL-TASKS.md +0 -30
  27. package/docs/MARKETING_WEBSITE_TRACKER.md +0 -677
  28. package/docs/NATIVE_UPDATES_GUIDE.md +0 -695
  29. package/docs/PACKAGES.md +0 -167
  30. package/docs/PERFORMANCE.md +0 -110
  31. package/docs/PROJECT_COMPLETION_TRACKER.md +0 -411
  32. package/docs/QUICK_START.md +0 -595
  33. package/docs/README.md +0 -130
  34. package/docs/REMAINING_FEATURES.md +0 -192
  35. package/docs/ROADMAP.md +0 -295
  36. package/docs/SECURITY-IF-REPO-PUBLIC.md +0 -232
  37. package/docs/SECURITY.md +0 -356
  38. package/docs/TESTING_REQUIREMENTS.md +0 -201
  39. package/docs/ai-knowledge-base/00-project-profile.md +0 -38
  40. package/docs/ai-knowledge-base/01-features.md +0 -46
  41. package/docs/ai-knowledge-base/02-routes.md +0 -72
  42. package/docs/ai-knowledge-base/03-tech-stack.md +0 -57
  43. package/docs/ai-knowledge-base/README.md +0 -23
  44. package/docs/analytics-tracking.md +0 -37
  45. package/docs/api/API.md +0 -558
  46. package/docs/api/FEATURES.md +0 -414
  47. package/docs/api/app-review-api.md +0 -239
  48. package/docs/api/app-update-api.md +0 -154
  49. package/docs/api/background-update-api.md +0 -170
  50. package/docs/api/events-api.md +0 -323
  51. package/docs/api/live-update-api.md +0 -258
  52. package/docs/archive/MARKETING_WEBSITE_PLAN.md +0 -659
  53. package/docs/background-updates.md +0 -392
  54. package/docs/capacitor-official-plugins.md +0 -46
  55. package/docs/capawesome-plugins.md +0 -29
  56. package/docs/cli-reference.md +0 -321
  57. package/docs/deployment/HOSTINGER_DEPLOY.md +0 -370
  58. package/docs/deployment/PRODUCTION-DEPLOY-CHECKLIST.md +0 -184
  59. package/docs/docs-site/plan.md +0 -201
  60. package/docs/docs-site/scope.md +0 -127
  61. package/docs/docs-site/tracker.json +0 -235
  62. package/docs/error-handling-tracking.md +0 -37
  63. package/docs/examples/advanced-scenarios.md +0 -394
  64. package/docs/examples/android-manifest-example.xml +0 -77
  65. package/docs/examples/basic-usage.md +0 -206
  66. package/docs/examples/node-express-backend-example.md +0 -28
  67. package/docs/examples/react-capacitor-example.md +0 -29
  68. package/docs/features/app-reviews.md +0 -975
  69. package/docs/features/app-updates.md +0 -785
  70. package/docs/features/e2e-full-verification/00-overview.md +0 -99
  71. package/docs/features/e2e-full-verification/00-tracker.json +0 -284
  72. package/docs/features/e2e-full-verification/phase01-backend-schema-fixes.md +0 -183
  73. package/docs/features/e2e-full-verification/phase02-test-auth.md +0 -176
  74. package/docs/features/e2e-full-verification/phase03-api-test-coverage.md +0 -63
  75. package/docs/features/e2e-full-verification/phase04-frontend-package-contract-audit.md +0 -73
  76. package/docs/features/e2e-full-verification/phase05-browser-e2e-matrix.md +0 -69
  77. package/docs/features/e2e-full-verification/phase06-deploy-prod-smoke.md +0 -51
  78. package/docs/features/e2e-full-verification/results/phase01-drift-report.md +0 -50
  79. package/docs/features/e2e-full-verification/results/phase03-coverage-matrix.md +0 -215
  80. package/docs/features/e2e-full-verification/results/phase04-frontend-contract.md +0 -139
  81. package/docs/features/e2e-full-verification/results/phase05-e2e-results.md +0 -99
  82. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-01-dashboard.png +0 -0
  83. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-02-signup.png +0 -0
  84. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-03-settings-persisted.png +0 -0
  85. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04a-app-created.png +0 -0
  86. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04b-duplicate-bundle-422.png +0 -0
  87. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-05-plan-limit-403.png +0 -0
  88. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08a-upload-graceful-fail.png +0 -0
  89. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08b-builds-list.png +0 -0
  90. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-10-rollout-25pct.png +0 -0
  91. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-11-analytics.png +0 -0
  92. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-12-drive-disconnected.png +0 -0
  93. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-13-pricing.png +0 -0
  94. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-14-isolation-403.png +0 -0
  95. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15a-admin-overview.png +0 -0
  96. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15b-regular-user-admin-redirect.png +0 -0
  97. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-16a-delete-dialog.png +0 -0
  98. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-17-mobile-375.png +0 -0
  99. package/docs/features/e2e-full-verification/results/route-list.json +0 -1
  100. package/docs/features/laravel-nova-backend/ASSESSMENT-SUMMARY.md +0 -96
  101. package/docs/features/laravel-nova-backend/IMPLEMENTATION-PLAN.md +0 -504
  102. package/docs/features/laravel-nova-backend/progress-tracker.json +0 -184
  103. package/docs/features/live-updates.md +0 -642
  104. package/docs/features/queues-and-emails/00-overview.md +0 -41
  105. package/docs/features/queues-and-emails/00-tracker.json +0 -99
  106. package/docs/features/queues-and-emails/phase01-foundation.md +0 -15
  107. package/docs/features/queues-and-emails/phase02-queued-jobs.md +0 -19
  108. package/docs/features/queues-and-emails/phase03-transactional-emails.md +0 -16
  109. package/docs/features/queues-and-emails/phase04-quota-ops.md +0 -17
  110. package/docs/features/queues-and-emails/phase05-async-build-processing-DECISION.md +0 -16
  111. package/docs/features/queues-and-emails/phase06-verify-deploy.md +0 -17
  112. package/docs/getting-started/configuration.md +0 -469
  113. package/docs/getting-started/installation.md +0 -300
  114. package/docs/getting-started/quick-start.md +0 -430
  115. package/docs/guides/BACKEND_TEMPLATES_GUIDE.md +0 -183
  116. package/docs/guides/admin-panel.md +0 -268
  117. package/docs/guides/channel-management.md +0 -343
  118. package/docs/guides/dashboard-guide.md +0 -365
  119. package/docs/guides/deployment-guide.md +0 -335
  120. package/docs/guides/end-to-end-workflow.md +0 -491
  121. package/docs/guides/key-management.md +0 -284
  122. package/docs/guides/migration-from-codepush.md +0 -145
  123. package/docs/guides/security-best-practices.md +0 -1057
  124. package/docs/guides/testing-guide.md +0 -346
  125. package/docs/guides/troubleshooting.md +0 -482
  126. package/docs/package-audit.md +0 -41
  127. package/docs/plans/PLANNING_COMPLETE_SUMMARY.md +0 -361
  128. package/docs/plans/TASK_1_ANDROID_EXAMPLE_APP.md +0 -401
  129. package/docs/plans/TASK_2_API_ENDPOINTS.md +0 -856
  130. package/docs/plans/TASK_2_DASHBOARD_UI_UX.md +0 -820
  131. package/docs/plans/TASK_2_DATABASE_SCHEMA.md +0 -704
  132. package/docs/plans/TASK_2_GOOGLE_DRIVE_INTEGRATION.md +0 -646
  133. package/docs/plans/TASK_2_SAAS_ARCHITECTURE.md +0 -587
  134. package/docs/plans/TASK_2_USER_AUTHENTICATION.md +0 -600
  135. package/docs/play-store/ASO-METADATA.md +0 -5
  136. package/docs/play-store/DATA-SAFETY.md +0 -5
  137. package/docs/play-store/DECLARATIONS.md +0 -5
  138. package/docs/play-store/README.md +0 -27
  139. package/docs/play-store/RELEASE-NOTES.md +0 -99
  140. package/docs/play-store/RELEASE-STEPS.md +0 -6
  141. package/docs/play-store/STORE-LISTING.md +0 -7
  142. package/docs/play-store/SUBMISSION-CHECKLIST.md +0 -5
  143. package/docs/production-readiness.md +0 -475
  144. package/docs/project-audit/2026-05-16/00-FINALIZATION-PLAN.md +0 -123
  145. package/docs/project-audit/2026-05-16/01-BATCH-PLAN.md +0 -227
  146. package/docs/project-audit/2026-05-16/02-AUDIT-FINDINGS.md +0 -144
  147. package/docs/project-audit/2026-05-16/sessions/batch-01.md +0 -42
  148. package/docs/project-audit/2026-05-16/sessions/batch-02.md +0 -74
  149. package/docs/project-audit/2026-05-16/sessions/batch-03.md +0 -71
  150. package/docs/project-audit/2026-05-16/sessions/batch-04.md +0 -88
  151. package/docs/project-audit/2026-05-16/sessions/batch-05.md +0 -63
  152. package/docs/project-audit/2026-05-16/sessions/batch-06.md +0 -103
  153. package/docs/project-audit/2026-05-16/sessions/batch-07.md +0 -61
  154. package/docs/project-audit/2026-05-16/sessions/batch-08.md +0 -101
  155. package/docs/project-audit/2026-05-16/sessions/batch-09.md +0 -105
  156. package/docs/project-audit/2026-05-16/sessions/batch-10.md +0 -102
  157. package/docs/project-audit/AUDIT-HISTORY.md +0 -74
  158. package/docs/project-audit/BATCH-PLAN.md +0 -168
  159. package/docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md +0 -73
  160. package/docs/project-audit/PRODUCTION-READINESS-AUDIT-2026-05-08.md +0 -275
  161. package/docs/project-finalization/00-tracker.json +0 -60
  162. package/docs/project-knowledge-base/01-system-overview.md +0 -227
  163. package/docs/project-knowledge-base/02-routes-pages-forms-users.md +0 -352
  164. package/docs/project-knowledge-base/03-tech-stack-modules-services.md +0 -379
  165. package/docs/project-knowledge-base/04-data-models-integrations.md +0 -244
  166. package/docs/project-knowledge-base/05-docs-corpus-inventory.md +0 -256
  167. package/docs/project-knowledge-base/06-operations-testing-legal-content.md +0 -208
  168. package/docs/project-knowledge-base/README.md +0 -103
  169. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-05-19.md +0 -81
  170. package/docs/reports/AUDIT_SUMMARY_2025-12-26.md +0 -203
  171. package/docs/reports/CLAUDE-CODE-COMPLETION-PROMPT.md +0 -403
  172. package/docs/reports/CLAUDE_CODE_PROMPT.md +0 -29
  173. package/docs/reports/CODEBASE_STATUS_REPORT.md +0 -272
  174. package/docs/reports/COMPLETE_VERIFICATION.md +0 -106
  175. package/docs/reports/COMPREHENSIVE-PROJECT-AUDIT-2026-02-24.md +0 -747
  176. package/docs/reports/EVENT_FLOW_VERIFICATION.md +0 -80
  177. package/docs/reports/EXAMPLE_APPS_SIMPLIFICATION_COMPLETE.md +0 -369
  178. package/docs/reports/FINAL_STATUS.md +0 -122
  179. package/docs/reports/FINAL_VERIFICATION_CHECKLIST.md +0 -425
  180. package/docs/reports/MARKETING_WEBSITE_COMPLETE.md +0 -466
  181. package/docs/reports/PACKAGE_COMPLETENESS_REPORT.md +0 -130
  182. package/docs/reports/PRODUCTION_STATUS.md +0 -115
  183. package/docs/reports/PROJECT_RESTRUCTURE_2025-12-27.md +0 -287
  184. package/docs/reports/PROJECT_RESTRUCTURE_FINAL_SUMMARY.md +0 -464
  185. package/docs/reports/PUBLISHING_VERIFICATION.md +0 -144
  186. package/docs/reports/RELEASE_READY_SUMMARY.md +0 -99
  187. package/docs/reports/claude-completion.json +0 -241
  188. package/docs/rules-tracker.md +0 -102
  189. package/docs/security/PRE-LAUNCH-PENTEST-CHECKLIST.md +0 -116
  190. package/docs/security/certificate-pinning.md +0 -122
  191. package/docs/seo-aeo-rules.json +0 -3043
  192. package/docs/social-media-marketing/README.md +0 -81
  193. package/docs/social-media-marketing/posts-batch-01.md +0 -613
  194. package/docs/social-media-marketing/posts-batch-02.md +0 -528
  195. package/docs/social-media-marketing/whatsapp-messages-batch-01.md +0 -458
  196. package/docs/social-media-marketing/whatsapp-status-batch-01.md +0 -355
  197. package/docs/tracking/IMPLEMENTATION_TRACKER.md +0 -303
  198. package/docs/tracking/capacitor-rollout-note-2026-03-01.md +0 -21
  199. package/docs/tracking/completion-tracker-2026-02-24.json +0 -174
  200. package/docs/tracking/finalization-2026-05-16-tracker.json +0 -346
  201. package/docs/tracking/full-audit-tracker.json +0 -121
  202. package/docs/tracking/production-readiness-audit-tracker.json +0 -429
  203. package/docs/tracking/seo-checklist-tracker.json +0 -333
@@ -1,6 +1,7 @@
1
1
  import Foundation
2
2
  import Capacitor
3
3
  import CommonCrypto
4
+ import UIKit
4
5
  import ZIPFoundation
5
6
 
6
7
  class LiveUpdatePlugin {
@@ -88,7 +89,9 @@ class LiveUpdatePlugin {
88
89
  call.resolve([
89
90
  "status": "UPDATE_AVAILABLE",
90
91
  "version": latestVersion["version"] ?? "",
91
- "description": latestVersion["description"] ?? ""
92
+ // v3 wire contract field (legacy shape was "description")
93
+ "description": latestVersion["releaseNotes"] ?? "",
94
+ "mandatory": latestVersion["mandatory"] as? Bool ?? false
92
95
  ])
93
96
  } else {
94
97
  call.resolve([
@@ -302,8 +305,12 @@ class LiveUpdatePlugin {
302
305
  call.resolve([
303
306
  "available": true,
304
307
  "version": latestVersion["version"] ?? "",
305
- "url": latestVersion["url"] ?? "",
306
- "notes": latestVersion["notes"] ?? ""
308
+ // v3 wire contract fields (legacy shape was url/notes)
309
+ "url": latestVersion["downloadUrl"] ?? "",
310
+ "notes": latestVersion["releaseNotes"] ?? "",
311
+ "checksum": latestVersion["checksum"] ?? "",
312
+ "size": latestVersion["size"] as? Int ?? 0,
313
+ "mandatory": latestVersion["mandatory"] as? Bool ?? false
307
314
  ])
308
315
  } else {
309
316
  call.resolve(["available": false])
@@ -399,23 +406,72 @@ class LiveUpdatePlugin {
399
406
 
400
407
  // MARK: - Private Methods
401
408
 
409
+ /// v3 wire contract (mirrors src/core/update-check.ts):
410
+ /// GET {serverUrl}/v1/updates/check?channel={channel}
411
+ /// Headers: X-API-Key, X-Device-ID, X-Current-Version, X-Platform
412
+ /// (+ X-App-Version when the binary version is known)
413
+ /// Returns the parsed response when a newer bundle is AVAILABLE, else
414
+ /// nil ("up to date", auth failures, non-2xx — matching the TS
415
+ /// helper's behavior). Callers consume the v3 response fields:
416
+ /// version, downloadUrl, checksum, signature, size, mandatory,
417
+ /// releaseNotes.
402
418
  private func checkForUpdates(serverUrl: String, channel: String) async throws -> [String: Any]? {
403
- guard let url = URL(string: "\(serverUrl)/check?channel=\(channel)") else {
419
+ guard let apiKey = config?["apiKey"] as? String, !apiKey.isEmpty else {
420
+ NSLog("NativeUpdate: update check skipped — no apiKey configured (pass it via initialize({ apiKey }) or configure({ liveUpdate: { apiKey } }))")
421
+ return nil
422
+ }
423
+
424
+ let base = serverUrl.hasSuffix("/") ? String(serverUrl.dropLast()) : serverUrl
425
+ let encodedChannel = channel.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? channel
426
+ guard let url = URL(string: "\(base)/v1/updates/check?channel=\(encodedChannel)") else {
404
427
  throw NSError(domain: "LiveUpdatePlugin", code: 2, userInfo: [
405
428
  NSLocalizedDescriptionKey: "Invalid server URL"
406
429
  ])
407
430
  }
408
-
409
- let (data, _) = try await session.data(from: url)
410
-
431
+
432
+ var request = URLRequest(url: url)
433
+ request.setValue(apiKey, forHTTPHeaderField: "X-API-Key")
434
+ request.setValue(getOrCreateDeviceId(), forHTTPHeaderField: "X-Device-ID")
435
+ request.setValue(getCurrentVersion(), forHTTPHeaderField: "X-Current-Version")
436
+ request.setValue("ios", forHTTPHeaderField: "X-Platform")
437
+ if let binaryVersion = getBinaryVersion() {
438
+ request.setValue(binaryVersion, forHTTPHeaderField: "X-App-Version")
439
+ }
440
+
441
+ let (data, response) = try await session.data(for: request)
442
+
443
+ if let http = response as? HTTPURLResponse, !(200...299).contains(http.statusCode) {
444
+ NSLog("NativeUpdate: update check returned HTTP %d — treating as no update", http.statusCode)
445
+ return nil
446
+ }
447
+
411
448
  if let json = try JSONSerialization.jsonObject(with: data) as? [String: Any],
412
449
  let available = json["available"] as? Bool,
413
450
  available {
414
451
  return json
415
452
  }
416
-
453
+
417
454
  return nil
418
455
  }
456
+
457
+ /// Native binary version (sent as X-App-Version).
458
+ private func getBinaryVersion() -> String? {
459
+ return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
460
+ }
461
+
462
+ /// Stable per-install device id (sent as X-Device-ID; the backend uses
463
+ /// it for rollout bucketing). identifierForVendor when available, else
464
+ /// a minted UUID — persisted either way so it never changes.
465
+ private func getOrCreateDeviceId() -> String {
466
+ let defaults = UserDefaults.standard
467
+ if let existing = defaults.string(forKey: "native_update_device_id") {
468
+ return existing
469
+ }
470
+
471
+ let deviceId = UIDevice.current.identifierForVendor?.uuidString ?? UUID().uuidString
472
+ defaults.set(deviceId, forKey: "native_update_device_id")
473
+ return deviceId
474
+ }
419
475
 
420
476
  private func downloadBundle(from urlString: String, to directory: URL, bundleId: String) async throws -> URL {
421
477
  guard let url = URL(string: urlString) else {
@@ -44,18 +44,16 @@ public class NativeUpdatePlugin: CAPPlugin {
44
44
  }
45
45
 
46
46
  @objc func initialize(_ call: CAPPluginCall) {
47
- guard let config = call.getObject("config") else {
48
- call.reject("Configuration object is required")
49
- return
50
- }
51
-
52
47
  do {
53
48
  // Initialize with filesystem and preferences if provided
54
49
  // In iOS, we typically don't need these as we use native APIs
55
-
56
- // Apply configuration
50
+
51
+ // Apply configuration. Both the wrapped ({ config: {...} }) and
52
+ // the flat PluginInitConfig shapes are accepted — configure()
53
+ // normalizes them (v3.1.3: the flat initialize() used to be
54
+ // rejected here, so native never received serverUrl/apiKey).
57
55
  configure(call)
58
-
56
+
59
57
  isInitialized = true
60
58
  call.resolve()
61
59
  } catch {
@@ -87,19 +85,26 @@ public class NativeUpdatePlugin: CAPPlugin {
87
85
  }
88
86
 
89
87
  @objc func configure(_ call: CAPPluginCall) {
90
- guard let config = call.getObject("config") else {
88
+ // Accept BOTH documented shapes (v3.1.3):
89
+ // configure({ config: PluginInitConfig }) — wrapped
90
+ // initialize(PluginInitConfig) — flat (top-level keys)
91
+ // configure(UpdateConfig) — nested sections
92
+ // Before this fix only the wrapped shape reached native, so the
93
+ // flat initialize() every consumer uses configured NOTHING here.
94
+ let wrapped = call.getObject("config").map { $0 as [String: Any] }
95
+ guard let config = wrapped ?? (call.options as? [String: Any]) else {
91
96
  call.reject("Configuration object is required")
92
97
  return
93
98
  }
94
-
99
+
95
100
  do {
96
101
  // Validate security settings
97
102
  if let securityConfig = config["security"] as? [String: Any] {
98
103
  try securityManager.configure(securityConfig)
99
104
  }
100
-
105
+
101
106
  // Configure sub-plugins
102
- if let liveUpdateConfig = config["liveUpdate"] as? [String: Any] {
107
+ if let liveUpdateConfig = (config["liveUpdate"] as? [String: Any]) ?? Self.buildFlatLiveUpdateConfig(from: config) {
103
108
  try liveUpdatePlugin.configure(liveUpdateConfig)
104
109
  }
105
110
 
@@ -120,7 +125,28 @@ public class NativeUpdatePlugin: CAPPlugin {
120
125
  call.reject("Configuration failed", error.localizedDescription)
121
126
  }
122
127
  }
123
-
128
+
129
+ /// Normalize a flat PluginInitConfig (serverUrl/baseUrl, apiKey, appId,
130
+ /// channel, publicKey at the top level) into the liveUpdate config shape
131
+ /// the sub-plugin reads. Returns nil when the payload carries no
132
+ /// live-update fields at all.
133
+ private static func buildFlatLiveUpdateConfig(from config: [String: Any]) -> [String: Any]? {
134
+ let serverUrl = (config["serverUrl"] as? String) ?? (config["baseUrl"] as? String)
135
+ let apiKey = config["apiKey"] as? String
136
+ if serverUrl == nil && apiKey == nil {
137
+ return nil
138
+ }
139
+
140
+ var liveUpdate: [String: Any] = [:]
141
+ if let serverUrl = serverUrl { liveUpdate["serverUrl"] = serverUrl }
142
+ if let apiKey = apiKey { liveUpdate["apiKey"] = apiKey }
143
+ if let appId = config["appId"] as? String { liveUpdate["appId"] = appId }
144
+ if let channel = config["channel"] as? String { liveUpdate["channel"] = channel }
145
+ if let publicKey = config["publicKey"] as? String { liveUpdate["publicKey"] = publicKey }
146
+ if let security = config["security"] as? [String: Any] { liveUpdate["security"] = security }
147
+ return liveUpdate
148
+ }
149
+
124
150
  @objc func getSecurityInfo(_ call: CAPPluginCall) {
125
151
  call.resolve(securityManager.getSecurityInfo())
126
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-update",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "engines": {
5
5
  "node": ">=24.16.0"
6
6
  },
@@ -33,7 +33,10 @@
33
33
  "dist/",
34
34
  "ios/Plugin/",
35
35
  "NativeUpdate.podspec",
36
- "docs/",
36
+ "docs/CHANGELOG.md",
37
+ "docs/MIGRATION.md",
38
+ "docs/server-requirements.md",
39
+ "docs/KNOWN_LIMITATIONS.md",
37
40
  "cli/",
38
41
  "AI-INTEGRATION-GUIDE.md"
39
42
  ],
@@ -105,7 +108,9 @@
105
108
  "typescript": "^6.0.3"
106
109
  },
107
110
  "peerDependencies": {
108
- "@capacitor/core": "^8.0.1"
111
+ "@capacitor/core": "^8.0.1",
112
+ "@capacitor/filesystem": ">=8.0.0",
113
+ "@capacitor/preferences": ">=8.0.0"
109
114
  },
110
115
  "capacitor": {
111
116
  "ios": {
package/docs/AGENTS.md DELETED
@@ -1,47 +0,0 @@
1
- # AGENTS.md - Documentation
2
-
3
- Agent instructions for maintaining native-update documentation.
4
-
5
- ## 🔴 3-Day Freshness Rule
6
- Check and update this file at least every 3 days. See root AGENTS.md.
7
-
8
- ## Scope
9
-
10
- All markdown documentation, guides, API reference, project profiles, knowledge base, and tracker files.
11
-
12
- ## Key Rules
13
-
14
- 1. **Documentation-first**: Update docs BEFORE or WITH code changes, never after
15
- 2. **Knowledge base**: Update `/docs/project-knowledge-base/` every 2 weeks minimum
16
- 3. **Project profile**: Update `/docs/project-profiles/` weekly when project is active
17
- 4. **Inventory sync**: When docs are added/removed, update `05-docs-corpus-inventory.md`
18
- 5. **No stale docs**: Every doc must reflect current reality, not historical plans
19
-
20
- ## When API Changes
21
- 1. Update relevant guides in `docs/features/` or `docs/guides/`
22
- 2. Update `docs/api/` reference
23
- 3. Update `AI-INTEGRATION-GUIDE.md`
24
- 4. Update `CHANGELOG.md`
25
- 5. If breaking: update `MIGRATION.md`
26
-
27
- ## When Adding New Docs
28
- 1. Place in appropriate subfolder by topic
29
- 2. Update `docs/project-knowledge-base/05-docs-corpus-inventory.md`
30
- 3. Link from relevant parent docs
31
- 4. Include `Last Updated` date at bottom
32
-
33
- ## Tracker Files
34
- Located in `docs/tracking/`. Update relevant trackers when completing cross-project work.
35
-
36
- ---
37
-
38
- **Last Updated**: 2026-04-02
39
-
40
-
41
- ## Sub-agents & Skills — Main-Context-First (IRON-SOLID)
42
- Default/built-in sub-agents (`general-purpose`, `Explore`, `Plan`, `claude`, `fork`, …) do NOT have
43
- access to `/skills`, so delegating to them silently SKIPS the skills RULE #0 requires. Do all
44
- skill-relevant work in the **MAIN context**; use a sub-agent ONLY when a **custom** agent exists in
45
- `.claude/agents/` for that job; a default `Explore`/`Plan` agent is allowed ONLY for read-only,
46
- no-skill search/exploration. When a relevant skill is missing, **install/enable it** rather than
47
- proceeding skill-less. (Owner directive 2026-07-11; full text in `~/.claude/CLAUDE.md`.)