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,300 +0,0 @@
1
- # Installation Guide
2
-
3
- > **⚠️ WARNING: What's NOT Included**
4
- >
5
- > Installing this plugin gives you **client-side functionality only**. You will NOT get:
6
- >
7
- > - ❌ An update server (you must build your own)
8
- > - ❌ Bundle generation tools (requires custom CI/CD setup)
9
- > - ❌ Ready-to-use backend API (implement from scratch)
10
- > - ❌ Admin dashboard or management UI
11
- > - ❌ Bundle hosting or CDN setup
12
- > - ❌ Security infrastructure (certificates, signing keys)
13
- > - ❌ Analytics or monitoring systems
14
- >
15
- > **Before proceeding**, ensure you have the technical resources to build the complete backend infrastructure. This plugin is only useful if you can implement the extensive server-side requirements.
16
-
17
- This guide will walk you through installing and setting up the Capacitor Native Update plugin in your project.
18
-
19
- ## Prerequisites
20
-
21
- Before installing the plugin, ensure you have:
22
-
23
- - **Capacitor 7.0.0** or higher installed in your project
24
- - **Node.js 18+** and npm/yarn installed
25
- - **iOS Requirements**: Xcode 14+ and iOS 13.0+ deployment target
26
- - **Android Requirements**: Android Studio and minimum SDK 21 (Android 5.0)
27
-
28
- ## Installation Steps
29
-
30
- ### 1. Install the Plugin
31
-
32
- ```bash
33
- yarn add native-update
34
- ```
35
-
36
- ### 2. Sync Native Projects
37
-
38
- After installation, sync the plugin with your native projects:
39
-
40
- ```bash
41
- npx cap sync
42
- ```
43
-
44
- This command will:
45
-
46
- - Copy the web assets to native projects
47
- - Install the native dependencies
48
- - Update native project configurations
49
-
50
- ### 3. Platform-Specific Setup
51
-
52
- #### iOS Setup
53
-
54
- 1. Open your iOS project in Xcode:
55
-
56
- ```bash
57
- npx cap open ios
58
- ```
59
-
60
- 2. Ensure your deployment target is set to iOS 13.0 or higher:
61
- - Select your project in Xcode
62
- - Go to the "General" tab
63
- - Set "Minimum Deployments" to iOS 13.0
64
-
65
- 3. Add required permissions to `Info.plist` (if not already present):
66
- ```xml
67
- <key>NSAppTransportSecurity</key>
68
- <dict>
69
- <key>NSAllowsArbitraryLoads</key>
70
- <false/>
71
- </dict>
72
- ```
73
-
74
- #### Android Setup
75
-
76
- 1. Open your Android project:
77
-
78
- ```bash
79
- npx cap open android
80
- ```
81
-
82
- 2. Ensure your `minSdkVersion` is 21 or higher in `android/variables.gradle`:
83
-
84
- ```gradle
85
- ext {
86
- minSdkVersion = 21
87
- targetSdkVersion = 34
88
- compileSdkVersion = 34
89
- }
90
- ```
91
-
92
- 3. The plugin automatically adds required permissions to the manifest:
93
- - **`INTERNET`** - Required for downloading update bundles from your server
94
- - **`ACCESS_NETWORK_STATE`** - Required to check network availability before downloading
95
- - **`WAKE_LOCK`** - Required to keep the device awake during background downloads
96
- - **`FOREGROUND_SERVICE`** - Required for showing download progress notifications
97
- - **`POST_NOTIFICATIONS`** - Required for update notifications on Android 13+ ([API 33](https://developer.android.com/develop/ui/views/notifications/notification-permission))
98
- - **`RECEIVE_BOOT_COMPLETED`** - Required to resume interrupted downloads after device restart
99
-
100
- 4. **CRITICAL: Android Manifest Configuration for Background Updates**
101
-
102
- If you're using background updates, you **MUST** add these elements to your app's `AndroidManifest.xml` inside the `<application>` tag. Without these, background updates will fail silently:
103
-
104
- ```xml
105
- <application>
106
- <!-- Your existing application configuration -->
107
-
108
- <!-- WorkManager Foreground Service (REQUIRED for background downloads) -->
109
- <!-- Without this: Background downloads will be killed by the system after ~10 minutes -->
110
- <!-- Documentation: https://developer.android.com/topic/libraries/architecture/workmanager/advanced/long-running -->
111
- <service
112
- android:name="androidx.work.impl.foreground.SystemForegroundService"
113
- android:foregroundServiceType="dataSync"
114
- tools:node="merge" />
115
-
116
- <!-- Notification Action Receiver (REQUIRED for update notifications) -->
117
- <!-- Without this: "Update Now" and "Dismiss" buttons in notifications won't work -->
118
- <!-- The receiver handles user actions from update notifications -->
119
- <receiver
120
- android:name="com.aoneahsan.nativeupdate.NotificationActionReceiver"
121
- android:exported="false">
122
- <intent-filter>
123
- <action android:name="com.aoneahsan.nativeupdate.UPDATE_NOW" />
124
- <action android:name="com.aoneahsan.nativeupdate.UPDATE_LATER" />
125
- <action android:name="com.aoneahsan.nativeupdate.DISMISS" />
126
- </intent-filter>
127
- </receiver>
128
- </application>
129
- ```
130
-
131
- **What happens if you skip this step:**
132
- - ❌ Background downloads will be terminated by Android after ~10 minutes
133
- - ❌ Update notifications won't display progress
134
- - ❌ Notification action buttons won't respond to taps
135
- - ❌ Downloads won't resume after app restart
136
- - ❌ Users will experience failed or incomplete updates
137
-
138
- **Detailed Explanation of Each Component:**
139
-
140
- - **SystemForegroundService**: Android's WorkManager service that handles long-running background tasks
141
- - **Purpose**: Keeps downloads alive when app is backgrounded or device is locked
142
- - **`foregroundServiceType="dataSync"`**: Tells Android this service downloads/syncs data
143
- - **What breaks without it**: Background downloads crash with `ServiceNotFoundException`
144
- - **Reference**: [WorkManager Long-running Workers](https://developer.android.com/topic/libraries/architecture/workmanager/advanced/long-running)
145
-
146
- - **NotificationActionReceiver**: Handles user interactions with update notifications
147
- - **`UPDATE_NOW`**: Triggered when user taps "Update Now" - starts immediate installation
148
- - **`UPDATE_LATER`**: Triggered when user taps "Update Later" - schedules for later
149
- - **`DISMISS`**: Triggered when user dismisses notification - cancels pending update
150
- - **What breaks without it**: Buttons appear in notifications but don't do anything when tapped
151
- - **Reference**: [Notification Actions](https://developer.android.com/develop/ui/views/notifications/notification-actions)
152
-
153
- - **Security Attributes Explained**:
154
- - **`android:exported="false"`**: Prevents other apps from sending intents to your receiver (security best practice)
155
- - **`tools:node="merge"`**: Handles conflicts if multiple libraries define the same service
156
-
157
- **Note:** If you're only using immediate (foreground) updates, these additions are optional.
158
-
159
- 📋 **[View Complete Android Manifest Example](../examples/android-manifest-example.xml)** - Shows the correct placement of all elements
160
-
161
- #### Web Setup
162
-
163
- No additional setup is required for web platform. The plugin provides fallback implementations for all features.
164
-
165
- ### 4. Initialize the Plugin
166
-
167
- In your app's initialization code (e.g., `main.ts`, `app.component.ts`, or `App.jsx`):
168
-
169
- ```typescript
170
- import { NativeUpdate } from 'native-update';
171
-
172
- // Basic initialization
173
- await NativeUpdate.configure({
174
- liveUpdate: {
175
- appId: 'your-app-id',
176
- serverUrl: 'https://your-update-server.com',
177
- channel: 'production',
178
- autoUpdate: true,
179
- },
180
- });
181
- ```
182
-
183
- ## Verification
184
-
185
- To verify the installation:
186
-
187
- 1. Build and run your app:
188
-
189
- ```bash
190
- npx cap run ios
191
- # or
192
- npx cap run android
193
- ```
194
-
195
- 2. Check the console logs for initialization messages
196
-
197
- 3. Test basic functionality:
198
-
199
- ```typescript
200
- // Get current bundle info
201
- const currentBundle = await NativeUpdate.current();
202
- console.log('Current bundle:', currentBundle);
203
-
204
- // Check for updates
205
- const latest = await NativeUpdate.getLatest();
206
- console.log('Latest version available:', latest);
207
- ```
208
-
209
- ## TypeScript Support
210
-
211
- The plugin includes comprehensive TypeScript definitions. Your IDE should provide full autocompletion and type checking.
212
-
213
- To import types:
214
-
215
- ```typescript
216
- import type {
217
- UpdateConfig,
218
- BundleInfo,
219
- SyncResult,
220
- } from 'native-update';
221
- ```
222
-
223
- ## Troubleshooting Installation
224
-
225
- ### Android Manifest Errors
226
-
227
- 1. **"AAPT: error: unexpected element <service> found in <manifest>"**
228
- - **Cause**: Service/receiver elements placed outside `<application>` tag or in wrong manifest
229
- - **Fix**: Add to your **app's** manifest at `android/app/src/main/AndroidManifest.xml`, NOT the plugin's manifest
230
- - **Example of CORRECT placement**:
231
- ```xml
232
- <manifest>
233
- <uses-permission ... />
234
- <application>
235
- <!-- HERE is where service and receiver go -->
236
- <service ... />
237
- <receiver ... />
238
- </application>
239
- </manifest>
240
- ```
241
-
242
- 2. **"ServiceNotFoundException" when downloading updates**
243
- - **Cause**: Missing WorkManager service declaration
244
- - **Symptoms**: App crashes when starting background download
245
- - **Fix**: Add the SystemForegroundService to your app's manifest as shown above
246
- - **Log message**: `java.lang.IllegalArgumentException: Service not registered: androidx.work.impl.foreground.SystemForegroundService`
247
-
248
- 3. **Notification buttons don't work**
249
- - **Cause**: Missing NotificationActionReceiver declaration
250
- - **Symptoms**: Update notification appears but buttons don't respond
251
- - **Fix**: Add the receiver with all three action filters to your app's manifest
252
- - **Test**: Send a test notification and verify buttons trigger actions
253
-
254
- 4. **"Permission denied" errors on Android 13+**
255
- - **Cause**: Missing runtime permission request for notifications
256
- - **Fix**: Request `POST_NOTIFICATIONS` permission at runtime
257
- - **Reference**: [Android 13 Notification Permission](https://developer.android.com/develop/ui/views/notifications/notification-permission)
258
-
259
- ### Common Issues
260
-
261
- 1. **"Module not found" error**
262
- - Run `yarn install` again
263
- - Delete `node_modules` and reinstall
264
- - Ensure you've run `npx cap sync`
265
-
266
- 2. **iOS build errors**
267
- - Clean build folder: `Product > Clean Build Folder` in Xcode
268
- - Delete `DerivedData` folder
269
- - Run `pod install` in the `ios/App` directory
270
-
271
- 3. **Android build errors**
272
- - Clean and rebuild: `./gradlew clean` in Android Studio
273
- - Sync project with Gradle files
274
- - Ensure Android Gradle Plugin is up to date
275
-
276
- 4. **TypeScript errors**
277
- - Update TypeScript to 4.0 or higher
278
- - Restart your TypeScript language server
279
- - Check `tsconfig.json` includes the plugin types
280
-
281
- ## Next Steps
282
-
283
- After successful installation:
284
-
285
- 1. Read the [Quick Start Guide](https://nativeupdate.aoneahsan.com/docs/getting-started/quick-start) for basic usage
286
- 2. Configure the plugin with your [update server settings](https://nativeupdate.aoneahsan.com/docs/getting-started/configuration)
287
- 3. Implement [security best practices](https://nativeupdate.aoneahsan.com/docs/guides/security-best-practices)
288
- 4. Set up your update server (see backend-template folder)
289
-
290
- ## Support
291
-
292
- If you encounter any issues during installation:
293
-
294
- - Check our [Testing Guide](https://nativeupdate.aoneahsan.com/docs/guides/testing-guide)
295
- - Visit [nativeupdate.aoneahsan.com/contact](https://nativeupdate.aoneahsan.com/contact) for support
296
- - Email aoneahsan@gmail.com with detailed information about your setup
297
-
298
- ---
299
-
300
- Made with ❤️ by Ahsan Mahmood