native-update 3.1.2 → 3.1.4

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 (206) hide show
  1. package/AI-INTEGRATION-GUIDE.md +15 -10
  2. package/Readme.md +35 -35
  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/AGENTS.md +1 -1
  6. package/cli/CLAUDE.md +1 -1
  7. package/cli/commands/bundle-create.js +2 -2
  8. package/cli/index.js +11 -0
  9. package/dist/esm/definitions.d.ts +8 -0
  10. package/dist/esm/plugin.js +16 -2
  11. package/dist/plugin.cjs.js +1 -1
  12. package/dist/plugin.esm.js +1 -1
  13. package/dist/plugin.js +2 -2
  14. package/docs/CHANGELOG.md +90 -0
  15. package/docs/KNOWN_LIMITATIONS.md +2 -2
  16. package/docs/MIGRATION.md +1 -1
  17. package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +64 -8
  18. package/ios/Plugin/NativeUpdatePlugin.swift +39 -13
  19. package/package.json +8 -3
  20. package/docs/AGENTS.md +0 -47
  21. package/docs/APP_REVIEW_GUIDE.md +0 -768
  22. package/docs/BUNDLE_SIGNING.md +0 -277
  23. package/docs/CLAUDE.md +0 -110
  24. package/docs/COMPREHENSIVE_AUDIT_REPORT.md +0 -526
  25. package/docs/DEPLOY_NOTES.md +0 -116
  26. package/docs/EXAMPLE_APPS_SIMPLIFICATION_PLAN.md +0 -384
  27. package/docs/EXAMPLE_APPS_SIMPLIFICATION_TRACKER.md +0 -390
  28. package/docs/LIVE_UPDATES_GUIDE.md +0 -675
  29. package/docs/MANUAL-TASKS.md +0 -30
  30. package/docs/MARKETING_WEBSITE_TRACKER.md +0 -677
  31. package/docs/NATIVE_UPDATES_GUIDE.md +0 -695
  32. package/docs/PACKAGES.md +0 -167
  33. package/docs/PERFORMANCE.md +0 -110
  34. package/docs/PROJECT_COMPLETION_TRACKER.md +0 -411
  35. package/docs/QUICK_START.md +0 -595
  36. package/docs/README.md +0 -130
  37. package/docs/REMAINING_FEATURES.md +0 -192
  38. package/docs/ROADMAP.md +0 -295
  39. package/docs/SECURITY-IF-REPO-PUBLIC.md +0 -232
  40. package/docs/SECURITY.md +0 -356
  41. package/docs/TESTING_REQUIREMENTS.md +0 -201
  42. package/docs/ai-knowledge-base/00-project-profile.md +0 -38
  43. package/docs/ai-knowledge-base/01-features.md +0 -46
  44. package/docs/ai-knowledge-base/02-routes.md +0 -72
  45. package/docs/ai-knowledge-base/03-tech-stack.md +0 -57
  46. package/docs/ai-knowledge-base/README.md +0 -23
  47. package/docs/analytics-tracking.md +0 -37
  48. package/docs/api/API.md +0 -558
  49. package/docs/api/FEATURES.md +0 -414
  50. package/docs/api/app-review-api.md +0 -239
  51. package/docs/api/app-update-api.md +0 -154
  52. package/docs/api/background-update-api.md +0 -170
  53. package/docs/api/events-api.md +0 -323
  54. package/docs/api/live-update-api.md +0 -258
  55. package/docs/archive/MARKETING_WEBSITE_PLAN.md +0 -659
  56. package/docs/background-updates.md +0 -392
  57. package/docs/capacitor-official-plugins.md +0 -46
  58. package/docs/capawesome-plugins.md +0 -29
  59. package/docs/cli-reference.md +0 -321
  60. package/docs/deployment/HOSTINGER_DEPLOY.md +0 -370
  61. package/docs/deployment/PRODUCTION-DEPLOY-CHECKLIST.md +0 -184
  62. package/docs/docs-site/plan.md +0 -201
  63. package/docs/docs-site/scope.md +0 -127
  64. package/docs/docs-site/tracker.json +0 -235
  65. package/docs/error-handling-tracking.md +0 -37
  66. package/docs/examples/advanced-scenarios.md +0 -394
  67. package/docs/examples/android-manifest-example.xml +0 -77
  68. package/docs/examples/basic-usage.md +0 -206
  69. package/docs/examples/node-express-backend-example.md +0 -28
  70. package/docs/examples/react-capacitor-example.md +0 -29
  71. package/docs/features/app-reviews.md +0 -975
  72. package/docs/features/app-updates.md +0 -785
  73. package/docs/features/e2e-full-verification/00-overview.md +0 -99
  74. package/docs/features/e2e-full-verification/00-tracker.json +0 -284
  75. package/docs/features/e2e-full-verification/phase01-backend-schema-fixes.md +0 -183
  76. package/docs/features/e2e-full-verification/phase02-test-auth.md +0 -176
  77. package/docs/features/e2e-full-verification/phase03-api-test-coverage.md +0 -63
  78. package/docs/features/e2e-full-verification/phase04-frontend-package-contract-audit.md +0 -73
  79. package/docs/features/e2e-full-verification/phase05-browser-e2e-matrix.md +0 -69
  80. package/docs/features/e2e-full-verification/phase06-deploy-prod-smoke.md +0 -51
  81. package/docs/features/e2e-full-verification/results/phase01-drift-report.md +0 -50
  82. package/docs/features/e2e-full-verification/results/phase03-coverage-matrix.md +0 -215
  83. package/docs/features/e2e-full-verification/results/phase04-frontend-contract.md +0 -139
  84. package/docs/features/e2e-full-verification/results/phase05-e2e-results.md +0 -99
  85. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-01-dashboard.png +0 -0
  86. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-02-signup.png +0 -0
  87. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-03-settings-persisted.png +0 -0
  88. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04a-app-created.png +0 -0
  89. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04b-duplicate-bundle-422.png +0 -0
  90. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-05-plan-limit-403.png +0 -0
  91. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08a-upload-graceful-fail.png +0 -0
  92. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08b-builds-list.png +0 -0
  93. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-10-rollout-25pct.png +0 -0
  94. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-11-analytics.png +0 -0
  95. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-12-drive-disconnected.png +0 -0
  96. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-13-pricing.png +0 -0
  97. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-14-isolation-403.png +0 -0
  98. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15a-admin-overview.png +0 -0
  99. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15b-regular-user-admin-redirect.png +0 -0
  100. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-16a-delete-dialog.png +0 -0
  101. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-17-mobile-375.png +0 -0
  102. package/docs/features/e2e-full-verification/results/route-list.json +0 -1
  103. package/docs/features/laravel-nova-backend/ASSESSMENT-SUMMARY.md +0 -96
  104. package/docs/features/laravel-nova-backend/IMPLEMENTATION-PLAN.md +0 -504
  105. package/docs/features/laravel-nova-backend/progress-tracker.json +0 -184
  106. package/docs/features/live-updates.md +0 -642
  107. package/docs/features/queues-and-emails/00-overview.md +0 -41
  108. package/docs/features/queues-and-emails/00-tracker.json +0 -99
  109. package/docs/features/queues-and-emails/phase01-foundation.md +0 -15
  110. package/docs/features/queues-and-emails/phase02-queued-jobs.md +0 -19
  111. package/docs/features/queues-and-emails/phase03-transactional-emails.md +0 -16
  112. package/docs/features/queues-and-emails/phase04-quota-ops.md +0 -17
  113. package/docs/features/queues-and-emails/phase05-async-build-processing-DECISION.md +0 -16
  114. package/docs/features/queues-and-emails/phase06-verify-deploy.md +0 -17
  115. package/docs/getting-started/configuration.md +0 -469
  116. package/docs/getting-started/installation.md +0 -300
  117. package/docs/getting-started/quick-start.md +0 -430
  118. package/docs/guides/BACKEND_TEMPLATES_GUIDE.md +0 -183
  119. package/docs/guides/admin-panel.md +0 -268
  120. package/docs/guides/channel-management.md +0 -343
  121. package/docs/guides/dashboard-guide.md +0 -365
  122. package/docs/guides/deployment-guide.md +0 -335
  123. package/docs/guides/end-to-end-workflow.md +0 -491
  124. package/docs/guides/key-management.md +0 -284
  125. package/docs/guides/migration-from-codepush.md +0 -145
  126. package/docs/guides/security-best-practices.md +0 -1057
  127. package/docs/guides/testing-guide.md +0 -346
  128. package/docs/guides/troubleshooting.md +0 -482
  129. package/docs/package-audit.md +0 -41
  130. package/docs/plans/PLANNING_COMPLETE_SUMMARY.md +0 -361
  131. package/docs/plans/TASK_1_ANDROID_EXAMPLE_APP.md +0 -401
  132. package/docs/plans/TASK_2_API_ENDPOINTS.md +0 -856
  133. package/docs/plans/TASK_2_DASHBOARD_UI_UX.md +0 -820
  134. package/docs/plans/TASK_2_DATABASE_SCHEMA.md +0 -704
  135. package/docs/plans/TASK_2_GOOGLE_DRIVE_INTEGRATION.md +0 -646
  136. package/docs/plans/TASK_2_SAAS_ARCHITECTURE.md +0 -587
  137. package/docs/plans/TASK_2_USER_AUTHENTICATION.md +0 -600
  138. package/docs/play-store/ASO-METADATA.md +0 -5
  139. package/docs/play-store/DATA-SAFETY.md +0 -5
  140. package/docs/play-store/DECLARATIONS.md +0 -5
  141. package/docs/play-store/README.md +0 -27
  142. package/docs/play-store/RELEASE-NOTES.md +0 -99
  143. package/docs/play-store/RELEASE-STEPS.md +0 -6
  144. package/docs/play-store/STORE-LISTING.md +0 -7
  145. package/docs/play-store/SUBMISSION-CHECKLIST.md +0 -5
  146. package/docs/production-readiness.md +0 -475
  147. package/docs/project-audit/2026-05-16/00-FINALIZATION-PLAN.md +0 -123
  148. package/docs/project-audit/2026-05-16/01-BATCH-PLAN.md +0 -227
  149. package/docs/project-audit/2026-05-16/02-AUDIT-FINDINGS.md +0 -144
  150. package/docs/project-audit/2026-05-16/sessions/batch-01.md +0 -42
  151. package/docs/project-audit/2026-05-16/sessions/batch-02.md +0 -74
  152. package/docs/project-audit/2026-05-16/sessions/batch-03.md +0 -71
  153. package/docs/project-audit/2026-05-16/sessions/batch-04.md +0 -88
  154. package/docs/project-audit/2026-05-16/sessions/batch-05.md +0 -63
  155. package/docs/project-audit/2026-05-16/sessions/batch-06.md +0 -103
  156. package/docs/project-audit/2026-05-16/sessions/batch-07.md +0 -61
  157. package/docs/project-audit/2026-05-16/sessions/batch-08.md +0 -101
  158. package/docs/project-audit/2026-05-16/sessions/batch-09.md +0 -105
  159. package/docs/project-audit/2026-05-16/sessions/batch-10.md +0 -102
  160. package/docs/project-audit/AUDIT-HISTORY.md +0 -74
  161. package/docs/project-audit/BATCH-PLAN.md +0 -168
  162. package/docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md +0 -73
  163. package/docs/project-audit/PRODUCTION-READINESS-AUDIT-2026-05-08.md +0 -275
  164. package/docs/project-finalization/00-tracker.json +0 -60
  165. package/docs/project-knowledge-base/01-system-overview.md +0 -227
  166. package/docs/project-knowledge-base/02-routes-pages-forms-users.md +0 -352
  167. package/docs/project-knowledge-base/03-tech-stack-modules-services.md +0 -379
  168. package/docs/project-knowledge-base/04-data-models-integrations.md +0 -244
  169. package/docs/project-knowledge-base/05-docs-corpus-inventory.md +0 -256
  170. package/docs/project-knowledge-base/06-operations-testing-legal-content.md +0 -208
  171. package/docs/project-knowledge-base/README.md +0 -103
  172. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-05-19.md +0 -81
  173. package/docs/reports/AUDIT_SUMMARY_2025-12-26.md +0 -203
  174. package/docs/reports/CLAUDE-CODE-COMPLETION-PROMPT.md +0 -403
  175. package/docs/reports/CLAUDE_CODE_PROMPT.md +0 -29
  176. package/docs/reports/CODEBASE_STATUS_REPORT.md +0 -272
  177. package/docs/reports/COMPLETE_VERIFICATION.md +0 -106
  178. package/docs/reports/COMPREHENSIVE-PROJECT-AUDIT-2026-02-24.md +0 -747
  179. package/docs/reports/EVENT_FLOW_VERIFICATION.md +0 -80
  180. package/docs/reports/EXAMPLE_APPS_SIMPLIFICATION_COMPLETE.md +0 -369
  181. package/docs/reports/FINAL_STATUS.md +0 -122
  182. package/docs/reports/FINAL_VERIFICATION_CHECKLIST.md +0 -425
  183. package/docs/reports/MARKETING_WEBSITE_COMPLETE.md +0 -466
  184. package/docs/reports/PACKAGE_COMPLETENESS_REPORT.md +0 -130
  185. package/docs/reports/PRODUCTION_STATUS.md +0 -115
  186. package/docs/reports/PROJECT_RESTRUCTURE_2025-12-27.md +0 -287
  187. package/docs/reports/PROJECT_RESTRUCTURE_FINAL_SUMMARY.md +0 -464
  188. package/docs/reports/PUBLISHING_VERIFICATION.md +0 -144
  189. package/docs/reports/RELEASE_READY_SUMMARY.md +0 -99
  190. package/docs/reports/claude-completion.json +0 -241
  191. package/docs/rules-tracker.md +0 -102
  192. package/docs/security/PRE-LAUNCH-PENTEST-CHECKLIST.md +0 -116
  193. package/docs/security/certificate-pinning.md +0 -122
  194. package/docs/seo-aeo-rules.json +0 -3043
  195. package/docs/social-media-marketing/README.md +0 -81
  196. package/docs/social-media-marketing/posts-batch-01.md +0 -613
  197. package/docs/social-media-marketing/posts-batch-02.md +0 -528
  198. package/docs/social-media-marketing/whatsapp-messages-batch-01.md +0 -458
  199. package/docs/social-media-marketing/whatsapp-status-batch-01.md +0 -355
  200. package/docs/tracking/IMPLEMENTATION_TRACKER.md +0 -303
  201. package/docs/tracking/capacitor-rollout-note-2026-03-01.md +0 -21
  202. package/docs/tracking/completion-tracker-2026-02-24.json +0 -174
  203. package/docs/tracking/finalization-2026-05-16-tracker.json +0 -346
  204. package/docs/tracking/full-audit-tracker.json +0 -121
  205. package/docs/tracking/production-readiness-audit-tracker.json +0 -429
  206. package/docs/tracking/seo-checklist-tracker.json +0 -333
@@ -1,595 +0,0 @@
1
- # Quick Start Guide
2
-
3
- Get up and running with Capacitor Native Update in 5 minutes! This guide covers all three main features:
4
-
5
- 1. **Live Updates (OTA)** - Push JavaScript/CSS updates instantly
6
- 2. **Native App Updates** - Check and install app store updates
7
- 3. **App Reviews** - Request in-app ratings and reviews
8
-
9
- ## Installation
10
-
11
- ```bash
12
- # Install the plugin
13
- yarn add native-update
14
-
15
- # Sync with native projects
16
- npx cap sync
17
- ```
18
-
19
- ## Basic Setup
20
-
21
- ### 1. Configure the Plugin
22
-
23
- **capacitor.config.json**:
24
-
25
- ```json
26
- {
27
- "appId": "com.example.app",
28
- "appName": "MyApp",
29
- "plugins": {
30
- "NativeUpdate": {
31
- "updateUrl": "https://updates.example.com/api/v1",
32
- "autoCheck": true,
33
- "appStoreId": "123456789"
34
- }
35
- }
36
- }
37
- ```
38
-
39
- ### 2. Import and Initialize
40
-
41
- ```typescript
42
- import { NativeUpdate } from 'native-update';
43
-
44
- // Initialize on app start
45
- export class App {
46
- async ngOnInit() {
47
- await this.initializeUpdates();
48
- }
49
-
50
- async initializeUpdates() {
51
- // Check for all types of updates
52
- await this.checkLiveUpdates();
53
- await this.checkNativeUpdates();
54
-
55
- // Set up review prompt for later
56
- this.scheduleReviewPrompt();
57
- }
58
- }
59
- ```
60
-
61
- ## Feature 1: Live Updates (OTA)
62
-
63
- Push updates without app store review!
64
-
65
- ### Basic Implementation
66
-
67
- ```typescript
68
- import { NativeUpdate } from 'native-update';
69
-
70
- export class LiveUpdateService {
71
- async checkAndApplyUpdates() {
72
- try {
73
- // 1. Sync with the update server
74
- const result = await NativeUpdate.sync();
75
-
76
- if (result.status === 'UP_TO_DATE') {
77
- console.log('No updates available');
78
- return;
79
- }
80
-
81
- if (result.status === 'UPDATE_INSTALLED') {
82
- console.log(`Update ${result.bundle?.version} installed!`);
83
- // Reload to apply the update
84
- await NativeUpdate.reload();
85
- }
86
- } catch (error) {
87
- console.error('Update failed:', error);
88
- }
89
- }
90
- }
91
- ```
92
-
93
- ### With User Interface
94
-
95
- ```typescript
96
- export class UpdateUIService {
97
- constructor(
98
- private alertController: AlertController,
99
- private loadingController: LoadingController
100
- ) {}
101
-
102
- async checkForUpdatesWithUI() {
103
- const result = await NativeUpdate.sync();
104
-
105
- if (result.status === 'UP_TO_DATE') return;
106
-
107
- if (result.status === 'UPDATE_AVAILABLE') {
108
- // Show update dialog
109
- const alert = await this.alertController.create({
110
- header: 'Update Available',
111
- message: `Version ${result.bundle?.version} is ready!\n\nBug fixes and improvements`,
112
- buttons: [
113
- { text: 'Later', role: 'cancel' },
114
- {
115
- text: 'Update Now',
116
- handler: () => this.applyUpdate(),
117
- },
118
- ],
119
- });
120
-
121
- await alert.present();
122
- } else if (result.status === 'UPDATE_INSTALLED') {
123
- // Update already installed, just need to reload
124
- await NativeUpdate.reload();
125
- }
126
- }
127
-
128
- private async applyUpdate() {
129
- const loading = await this.loadingController.create({
130
- message: 'Applying update...',
131
- });
132
- await loading.present();
133
-
134
- try {
135
- // The sync method already downloaded the update
136
- // We just need to reload the app
137
- await NativeUpdate.reload();
138
- } catch (error) {
139
- await loading.dismiss();
140
- // Show error
141
- }
142
- }
143
- }
144
- ```
145
-
146
- ### Setting Up Update Server
147
-
148
- Use our example server or implement your own:
149
-
150
- ```bash
151
- # Using example server
152
- cd server-example
153
- yarn install
154
- yarn start
155
-
156
- # Upload a bundle
157
- curl -X POST http://localhost:3000/api/v1/bundles \
158
- -H "Authorization: Bearer your-token" \
159
- -F "file=@bundle.zip" \
160
- -F "version=1.0.1" \
161
- -F "channel=production"
162
- ```
163
-
164
- ## Feature 2: Native App Updates
165
-
166
- Check for app store updates and install them!
167
-
168
- ### Basic Implementation
169
-
170
- ```typescript
171
- export class NativeUpdateService {
172
- async checkForAppStoreUpdates() {
173
- try {
174
- const result = await NativeUpdate.getAppUpdateInfo();
175
-
176
- if (!result.updateAvailable) {
177
- console.log('App is up to date');
178
- return;
179
- }
180
-
181
- // Handle based on platform
182
- if (Capacitor.getPlatform() === 'android') {
183
- await this.handleAndroidUpdate(result);
184
- } else if (Capacitor.getPlatform() === 'ios') {
185
- await this.handleiOSUpdate(result);
186
- }
187
- } catch (error) {
188
- console.error('Native update check failed:', error);
189
- }
190
- }
191
-
192
- private async handleAndroidUpdate(result: any) {
193
- if (result.immediateUpdateAllowed) {
194
- // Critical update - must install
195
- await NativeUpdate.performImmediateUpdate();
196
- } else {
197
- // Optional update - download in background
198
- await NativeUpdate.startFlexibleUpdate();
199
- }
200
- }
201
-
202
- private async handleiOSUpdate(result: any) {
203
- // iOS can only redirect to App Store
204
- const alert = await this.alertController.create({
205
- header: 'Update Available',
206
- message: `Version ${result.availableVersion} is available on the App Store`,
207
- buttons: [
208
- { text: 'Later', role: 'cancel' },
209
- {
210
- text: 'Update',
211
- handler: () => NativeUpdate.openAppStore(),
212
- },
213
- ],
214
- });
215
- await alert.present();
216
- }
217
- }
218
- ```
219
-
220
- ### With Progress Tracking (Android)
221
-
222
- ```typescript
223
- export class AndroidUpdateProgress {
224
- downloadProgress = 0;
225
-
226
- async startFlexibleUpdate() {
227
- // Start download
228
- await NativeUpdate.startFlexibleUpdate();
229
-
230
- // Track progress
231
- NativeUpdate.addListener(
232
- 'appUpdateProgress',
233
- (progress) => {
234
- this.downloadProgress = Math.round(
235
- (progress.bytesDownloaded / progress.totalBytesToDownload) * 100
236
- );
237
- }
238
- );
239
-
240
- // Handle completion
241
- NativeUpdate.addListener('updateStateChanged', async (event) => {
242
- if (event.status === 'DOWNLOADED') {
243
- const alert = await this.alertController.create({
244
- header: 'Update Ready',
245
- message: 'Update has been downloaded. Install now?',
246
- buttons: [
247
- { text: 'Later' },
248
- {
249
- text: 'Install',
250
- handler: () => NativeUpdate.completeFlexibleUpdate(),
251
- },
252
- ],
253
- });
254
- await alert.present();
255
- }
256
- });
257
- }
258
- }
259
- ```
260
-
261
- ## Feature 3: App Reviews
262
-
263
- Request ratings without users leaving your app!
264
-
265
- ### Basic Implementation
266
-
267
- ```typescript
268
- export class AppReviewService {
269
- async requestReview() {
270
- try {
271
- const result = await NativeUpdate.requestReview();
272
-
273
- if (result.displayed) {
274
- console.log('Review prompt shown');
275
- // Track analytics
276
- }
277
- } catch (error) {
278
- console.error('Review request failed:', error);
279
- // Fallback to external review
280
- }
281
- }
282
- }
283
- ```
284
-
285
- ### Smart Review Prompts
286
-
287
- Only ask at the right moments:
288
-
289
- ```typescript
290
- export class SmartReviewService {
291
- private readonly MIN_SESSIONS = 3;
292
- private readonly MIN_DAYS_INSTALLED = 3;
293
-
294
- async checkAndRequestReview() {
295
- // Don't ask too early
296
- if (!(await this.isGoodTimeToAsk())) {
297
- return;
298
- }
299
-
300
- // Two-step approach
301
- const enjoying = await this.askIfEnjoying();
302
-
303
- if (enjoying) {
304
- await NativeUpdate.requestReview();
305
- } else {
306
- await this.askForFeedback();
307
- }
308
- }
309
-
310
- private async isGoodTimeToAsk(): Promise<boolean> {
311
- const sessions = await this.getSessionCount();
312
- const daysSinceInstall = await this.getDaysSinceInstall();
313
-
314
- return (
315
- sessions >= this.MIN_SESSIONS &&
316
- daysSinceInstall >= this.MIN_DAYS_INSTALLED
317
- );
318
- }
319
-
320
- private async askIfEnjoying(): Promise<boolean> {
321
- return new Promise((resolve) => {
322
- const alert = this.alertController.create({
323
- header: 'Enjoying MyApp?',
324
- buttons: [
325
- {
326
- text: 'Not really',
327
- handler: () => resolve(false),
328
- },
329
- {
330
- text: 'Yes!',
331
- handler: () => resolve(true),
332
- },
333
- ],
334
- });
335
- alert.present();
336
- });
337
- }
338
- }
339
- ```
340
-
341
- ### Review Triggers
342
-
343
- Call review prompts at optimal moments:
344
-
345
- ```typescript
346
- export class ReviewTriggers {
347
- constructor(private reviewService: SmartReviewService) {}
348
-
349
- // After completing important task
350
- async onTaskCompleted() {
351
- const taskCount = await this.getCompletedTasks();
352
-
353
- // Every 5 tasks
354
- if (taskCount % 5 === 0) {
355
- setTimeout(() => {
356
- this.reviewService.checkAndRequestReview();
357
- }, 2000);
358
- }
359
- }
360
-
361
- // After positive interaction
362
- async onPositiveEvent() {
363
- await this.reviewService.checkAndRequestReview();
364
- }
365
-
366
- // On app launch (with conditions)
367
- async onAppLaunch() {
368
- const lastPrompt = await this.getLastPromptDate();
369
- const daysSince = this.daysSince(lastPrompt);
370
-
371
- // Max once per month
372
- if (daysSince >= 30) {
373
- await this.reviewService.checkAndRequestReview();
374
- }
375
- }
376
- }
377
- ```
378
-
379
- ## Complete Example
380
-
381
- Here's everything working together:
382
-
383
- ```typescript
384
- import { Component, OnInit } from '@angular/core';
385
- import { NativeUpdate } from 'native-update';
386
- import { Capacitor } from '@capacitor/core';
387
-
388
- @Component({
389
- selector: 'app-root',
390
- templateUrl: 'app.component.html',
391
- })
392
- export class AppComponent implements OnInit {
393
- constructor(
394
- private platform: Platform,
395
- private alertCtrl: AlertController
396
- ) {}
397
-
398
- async ngOnInit() {
399
- await this.platform.ready();
400
-
401
- // Initialize all update features
402
- await this.initializeUpdates();
403
- }
404
-
405
- async initializeUpdates() {
406
- // 1. Check for live updates on startup
407
- this.checkLiveUpdates();
408
-
409
- // 2. Check for native updates periodically
410
- this.scheduleNativeUpdateCheck();
411
-
412
- // 3. Set up smart review prompts
413
- this.initializeReviewPrompts();
414
- }
415
-
416
- // Live Updates
417
- private async checkLiveUpdates() {
418
- try {
419
- const result = await NativeUpdate.sync();
420
-
421
- if (result.status === 'UPDATE_INSTALLED') {
422
- // Notify user
423
- const toast = await this.toastCtrl.create({
424
- message: 'Update ready! Restart to apply.',
425
- duration: 5000,
426
- buttons: [
427
- {
428
- text: 'Restart',
429
- handler: () => NativeUpdate.reload(),
430
- },
431
- ],
432
- });
433
- await toast.present();
434
- }
435
- } catch (error) {
436
- console.error('Live update check failed:', error);
437
- }
438
- }
439
-
440
- // Native Updates
441
- private scheduleNativeUpdateCheck() {
442
- // Check immediately
443
- this.checkNativeUpdates();
444
-
445
- // Then check daily
446
- setInterval(
447
- () => {
448
- this.checkNativeUpdates();
449
- },
450
- 24 * 60 * 60 * 1000
451
- );
452
- }
453
-
454
- private async checkNativeUpdates() {
455
- try {
456
- const result = await NativeUpdate.getAppUpdateInfo();
457
-
458
- if (result.updateAvailable && result.flexibleUpdateAllowed) {
459
- // Start background download for Android
460
- if (Capacitor.getPlatform() === 'android') {
461
- await NativeUpdate.startFlexibleUpdate();
462
- }
463
- }
464
- } catch (error) {
465
- console.error('Native update check failed:', error);
466
- }
467
- }
468
-
469
- // App Reviews
470
- private initializeReviewPrompts() {
471
- // Track positive events
472
- document.addEventListener('task-completed', () => {
473
- this.maybeRequestReview();
474
- });
475
-
476
- // Check on app foreground
477
- document.addEventListener('resume', () => {
478
- this.maybeRequestReview();
479
- });
480
- }
481
-
482
- private async maybeRequestReview() {
483
- const canAsk = await this.canAskForReview();
484
-
485
- if (canAsk) {
486
- await NativeUpdate.requestReview();
487
- await this.markReviewRequested();
488
- }
489
- }
490
-
491
- private async canAskForReview(): Promise<boolean> {
492
- // Your conditions here
493
- const lastAsked = await this.getLastReviewDate();
494
- const daysSince = this.daysSince(lastAsked);
495
-
496
- return daysSince > 30; // Once per month max
497
- }
498
- }
499
- ```
500
-
501
- ## Testing Your Implementation
502
-
503
- ### 1. Test Live Updates
504
-
505
- ```bash
506
- # Build your web app
507
- yarn build
508
-
509
- # Create update bundle
510
- cd www && zip -r ../update-1.0.1.zip . && cd ..
511
-
512
- # Upload to test server
513
- curl -X POST http://localhost:3000/api/v1/bundles \
514
- -H "Authorization: Bearer test-token" \
515
- -F "file=@update-1.0.1.zip" \
516
- -F "version=1.0.1"
517
-
518
- # Test in app
519
- ```
520
-
521
- ### 2. Test Native Updates
522
-
523
- **Android:**
524
-
525
- - Upload APK to Internal Test Track
526
- - Install older version
527
- - Open app to trigger update
528
-
529
- **iOS:**
530
-
531
- - Use TestFlight
532
- - Install older version
533
- - Check for updates in app
534
-
535
- ### 3. Test App Reviews
536
-
537
- ```typescript
538
- // Test review prompts
539
- // Note: Reviews may not show in development builds
540
- // Test with TestFlight (iOS) or Internal Test Track (Android)
541
- await NativeUpdate.requestReview();
542
- ```
543
-
544
- ## What's Next?
545
-
546
- Now that you have the basics working:
547
-
548
- 1. **Production Setup**:
549
- - Set up a proper update server
550
- - Implement bundle signing
551
- - Configure update channels
552
-
553
- 2. **Advanced Features**:
554
- - Delta updates for smaller downloads
555
- - A/B testing different update strategies
556
- - Rollback capabilities
557
-
558
- 3. **Deep Dive**:
559
- - [Live Updates Guide](https://nativeupdate.aoneahsan.com/docs/LIVE_UPDATES_GUIDE) - Complete OTA implementation
560
- - [Native Updates Guide](https://nativeupdate.aoneahsan.com/docs/NATIVE_UPDATES_GUIDE) - Platform-specific details
561
- - [App Review Guide](https://nativeupdate.aoneahsan.com/docs/APP_REVIEW_GUIDE) - Maximize review rates
562
- - [Security Guide](https://nativeupdate.aoneahsan.com/docs/guides/security-best-practices) - Best practices
563
- - [API Reference](https://nativeupdate.aoneahsan.com/docs/api/live-update-api) - All methods and options
564
-
565
- ## Troubleshooting
566
-
567
- ### Live Updates Not Working?
568
-
569
- ```typescript
570
- // Enable debug logging in your app
571
- console.log('Checking update configuration...');
572
-
573
- // Configuration is set in capacitor.config.json
574
- // Check your config file for updateUrl and other settings
575
- ```
576
-
577
- ### Native Updates Not Detected?
578
-
579
- - Ensure app is published on store
580
- - Check version numbers are correct
581
- - Verify package name matches
582
-
583
- ### Reviews Not Showing?
584
-
585
- - iOS: Limited to 3 times per year by system
586
- - Android: May be throttled by Play Store
587
- - Both: Won't show in development builds
588
-
589
- ## Support
590
-
591
- - 📖 [Documentation](https://nativeupdate.aoneahsan.com/docs)
592
- - 📦 [NPM Package](https://www.npmjs.com/package/native-update)
593
- - 📧 Email: aoneahsan@gmail.com
594
-
595
- Happy updating! 🚀
package/docs/README.md DELETED
@@ -1,130 +0,0 @@
1
- # Capacitor Native Update - Documentation
2
-
3
- Welcome to the comprehensive documentation for **Capacitor Native Update**, a complete update lifecycle management solution for Capacitor applications.
4
-
5
- ## Verified Status
6
-
7
- - Last reviewed: `2026-03-25`
8
- - Current package version: `1.4.9`
9
- - Build status: `yarn build` passed
10
- - Root package manager: `yarn@4.10.3`
11
- - Root package workflow is Yarn-only and no longer shells out to npm or pnpm
12
- - Root portfolio info file: `../NATIVE-UPDATE_portfolio-info_2026-03-25.md`
13
- - Current dated project profile: `./project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-03-25.md`
14
-
15
- > **Dashboard & Management Platform**: [nativeupdate.aoneahsan.com](https://nativeupdate.aoneahsan.com)
16
- >
17
- > The platform provides a complete SaaS solution for managing your updates including:
18
- > - Web dashboard for app and build management
19
- > - Google Drive integration for secure build storage
20
- > - Channel management (production/staging/development)
21
- > - Gradual rollout capabilities
22
- > - Analytics and monitoring
23
-
24
- Created by **Ahsan Mahmood** and open-sourced for the developer community, this plugin combines three essential update features:
25
-
26
- - **Live/OTA Updates** - Deploy web assets instantly without app store approval
27
- - **Native App Updates** - Manage app store updates with native UI
28
- - **App Review Integration** - Request user reviews at optimal moments
29
-
30
- ## 📚 Documentation Overview
31
-
32
- ### Getting Started
33
-
34
- - [**Installation**](https://nativeupdate.aoneahsan.com/docs/getting-started/installation) - How to install and set up the plugin
35
- - [**Quick Start**](https://nativeupdate.aoneahsan.com/docs/getting-started/quick-start) - Get up and running in minutes
36
- - [**Configuration**](https://nativeupdate.aoneahsan.com/docs/getting-started/configuration) - Detailed configuration options
37
- - [**End-to-End Workflow**](https://nativeupdate.aoneahsan.com/docs/guides/end-to-end-workflow) - Complete setup to production guide
38
-
39
- ### Dashboard & Management
40
-
41
- - [**Dashboard Guide**](https://nativeupdate.aoneahsan.com/docs/guides/dashboard-guide) - Complete dashboard user guide
42
- - [**Channel Management**](https://nativeupdate.aoneahsan.com/docs/guides/channel-management) - Production/staging/development channels
43
- - [**Admin Panel**](https://nativeupdate.aoneahsan.com/docs/guides/admin-panel) - Super-admin documentation
44
-
45
- ### Features
46
-
47
- - [**Live Updates**](https://nativeupdate.aoneahsan.com/docs/features/live-updates) - Deploy JavaScript/HTML/CSS updates instantly
48
- - [**App Updates**](https://nativeupdate.aoneahsan.com/docs/features/app-updates) - Native app store update management
49
- - [**App Reviews**](https://nativeupdate.aoneahsan.com/docs/features/app-reviews) - In-app review requests
50
-
51
- ### Guides
52
-
53
- - [**Security Best Practices**](https://nativeupdate.aoneahsan.com/docs/guides/security-best-practices) - Implement secure updates
54
- - [**Key Management**](https://nativeupdate.aoneahsan.com/docs/guides/key-management) - Generate and manage signing keys
55
- - [**Deployment Guide**](https://nativeupdate.aoneahsan.com/docs/guides/deployment-guide) - Deploy to production
56
- - [**Testing Guide**](https://nativeupdate.aoneahsan.com/docs/guides/testing-guide) - Testing your update implementation
57
- - [**Troubleshooting**](https://nativeupdate.aoneahsan.com/docs/guides/troubleshooting) - Common issues and solutions
58
- - [**Migration from CodePush**](https://nativeupdate.aoneahsan.com/docs/guides/migration-from-codepush) - Migrate from CodePush
59
-
60
- ### API Reference
61
-
62
- - [**Live Update API**](https://nativeupdate.aoneahsan.com/docs/api/live-update-api) - Complete API for OTA updates
63
- - [**App Update API**](https://nativeupdate.aoneahsan.com/docs/api/app-update-api) - Native app update methods
64
- - [**App Review API**](https://nativeupdate.aoneahsan.com/docs/api/app-review-api) - Review request methods
65
- - [**Events API**](https://nativeupdate.aoneahsan.com/docs/api/events-api) - Event listeners and handlers
66
-
67
- ### Examples
68
-
69
- - [**Basic Usage**](https://nativeupdate.aoneahsan.com/docs/examples/basic-usage) - Simple implementation examples
70
- - [**Advanced Scenarios**](https://nativeupdate.aoneahsan.com/docs/examples/advanced-scenarios) - Complex use cases and framework integrations
71
-
72
- ### Production
73
-
74
- - [**Production Readiness**](https://nativeupdate.aoneahsan.com/docs/production-readiness) - Checklist and best practices for production deployment
75
-
76
- ## 🚀 Quick Links
77
-
78
- - **NPM Package**: [native-update](https://www.npmjs.com/package/native-update)
79
- - **Website**: [nativeupdate.aoneahsan.com](https://nativeupdate.aoneahsan.com)
80
- - **Support**: Email aoneahsan@gmail.com
81
- - **Author**: [Ahsan Mahmood](https://aoneahsan.com)
82
-
83
- ## 💡 Key Features
84
-
85
- ### Type-Safe
86
-
87
- Full TypeScript support with comprehensive type definitions for all methods and interfaces.
88
-
89
- ### Framework Independent
90
-
91
- Works with any JavaScript framework - React, Vue, Angular, or vanilla JavaScript.
92
-
93
- ### Secure by Design
94
-
95
- Built-in security features including checksum validation, signature verification, and HTTPS enforcement.
96
-
97
- ### Performance Optimized
98
-
99
- Efficient bundle management with delta updates and background downloading capabilities.
100
-
101
- ### Cross-Platform
102
-
103
- Consistent API across iOS, Android, and Web platforms with platform-specific optimizations.
104
-
105
- ## 📋 Prerequisites
106
-
107
- - Capacitor 7.0.0 or higher
108
- - iOS 13.0+ for iOS apps
109
- - Android 5.0+ (API level 21) for Android apps
110
- - Node.js `>=24.13.0` for development
111
-
112
- ## 🤝 Contributing
113
-
114
- We welcome contributions from the community! Please see our [Contributing Guide](../CONTRIBUTING.md) for details, or contact aoneahsan@gmail.com.
115
-
116
- ## 📄 License
117
-
118
- This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details.
119
-
120
- ## 👨‍💻 About the Author
121
-
122
- **Ahsan Mahmood** is a passionate developer dedicated to creating high-quality, open-source tools for the developer community.
123
-
124
- - 🌐 Portfolio: [aoneahsan.com](https://aoneahsan.com)
125
- - 💼 LinkedIn: [aoneahsan](https://linkedin.com/in/aoneahsan)
126
- - 📧 Email: aoneahsan@gmail.com
127
-
128
- ---
129
-
130
- Created by Ahsan Mahmood for the developer community.