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.
- package/AI-INTEGRATION-GUIDE.md +98 -63
- package/Readme.md +89 -120
- package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +88 -12
- package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +45 -18
- package/cli/package.json +2 -2
- package/dist/esm/definitions.d.ts +8 -0
- package/dist/esm/plugin.js +16 -2
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.esm.js +1 -1
- package/dist/plugin.js +2 -2
- package/docs/CHANGELOG.md +108 -0
- package/docs/KNOWN_LIMITATIONS.md +2 -2
- package/docs/MIGRATION.md +1 -1
- package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +64 -8
- package/ios/Plugin/NativeUpdatePlugin.swift +39 -13
- package/package.json +8 -3
- package/docs/AGENTS.md +0 -47
- package/docs/APP_REVIEW_GUIDE.md +0 -768
- package/docs/BUNDLE_SIGNING.md +0 -277
- package/docs/CLAUDE.md +0 -110
- package/docs/COMPREHENSIVE_AUDIT_REPORT.md +0 -526
- package/docs/DEPLOY_NOTES.md +0 -117
- package/docs/EXAMPLE_APPS_SIMPLIFICATION_PLAN.md +0 -384
- package/docs/EXAMPLE_APPS_SIMPLIFICATION_TRACKER.md +0 -390
- package/docs/LIVE_UPDATES_GUIDE.md +0 -675
- package/docs/MANUAL-TASKS.md +0 -30
- package/docs/MARKETING_WEBSITE_TRACKER.md +0 -677
- package/docs/NATIVE_UPDATES_GUIDE.md +0 -695
- package/docs/PACKAGES.md +0 -167
- package/docs/PERFORMANCE.md +0 -110
- package/docs/PROJECT_COMPLETION_TRACKER.md +0 -411
- package/docs/QUICK_START.md +0 -595
- package/docs/README.md +0 -130
- package/docs/REMAINING_FEATURES.md +0 -192
- package/docs/ROADMAP.md +0 -295
- package/docs/SECURITY-IF-REPO-PUBLIC.md +0 -232
- package/docs/SECURITY.md +0 -356
- package/docs/TESTING_REQUIREMENTS.md +0 -201
- package/docs/ai-knowledge-base/00-project-profile.md +0 -38
- package/docs/ai-knowledge-base/01-features.md +0 -46
- package/docs/ai-knowledge-base/02-routes.md +0 -72
- package/docs/ai-knowledge-base/03-tech-stack.md +0 -57
- package/docs/ai-knowledge-base/README.md +0 -23
- package/docs/analytics-tracking.md +0 -37
- package/docs/api/API.md +0 -558
- package/docs/api/FEATURES.md +0 -414
- package/docs/api/app-review-api.md +0 -239
- package/docs/api/app-update-api.md +0 -154
- package/docs/api/background-update-api.md +0 -170
- package/docs/api/events-api.md +0 -323
- package/docs/api/live-update-api.md +0 -258
- package/docs/archive/MARKETING_WEBSITE_PLAN.md +0 -659
- package/docs/background-updates.md +0 -392
- package/docs/capacitor-official-plugins.md +0 -46
- package/docs/capawesome-plugins.md +0 -29
- package/docs/cli-reference.md +0 -321
- package/docs/deployment/HOSTINGER_DEPLOY.md +0 -370
- package/docs/deployment/PRODUCTION-DEPLOY-CHECKLIST.md +0 -184
- package/docs/docs-site/plan.md +0 -201
- package/docs/docs-site/scope.md +0 -127
- package/docs/docs-site/tracker.json +0 -235
- package/docs/error-handling-tracking.md +0 -37
- package/docs/examples/advanced-scenarios.md +0 -394
- package/docs/examples/android-manifest-example.xml +0 -77
- package/docs/examples/basic-usage.md +0 -206
- package/docs/examples/node-express-backend-example.md +0 -28
- package/docs/examples/react-capacitor-example.md +0 -29
- package/docs/features/app-reviews.md +0 -975
- package/docs/features/app-updates.md +0 -785
- package/docs/features/e2e-full-verification/00-overview.md +0 -99
- package/docs/features/e2e-full-verification/00-tracker.json +0 -284
- package/docs/features/e2e-full-verification/phase01-backend-schema-fixes.md +0 -183
- package/docs/features/e2e-full-verification/phase02-test-auth.md +0 -176
- package/docs/features/e2e-full-verification/phase03-api-test-coverage.md +0 -63
- package/docs/features/e2e-full-verification/phase04-frontend-package-contract-audit.md +0 -73
- package/docs/features/e2e-full-verification/phase05-browser-e2e-matrix.md +0 -69
- package/docs/features/e2e-full-verification/phase06-deploy-prod-smoke.md +0 -51
- package/docs/features/e2e-full-verification/results/phase01-drift-report.md +0 -50
- package/docs/features/e2e-full-verification/results/phase03-coverage-matrix.md +0 -215
- package/docs/features/e2e-full-verification/results/phase04-frontend-contract.md +0 -139
- package/docs/features/e2e-full-verification/results/phase05-e2e-results.md +0 -99
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-01-dashboard.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-02-signup.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-03-settings-persisted.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04a-app-created.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04b-duplicate-bundle-422.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-05-plan-limit-403.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08a-upload-graceful-fail.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08b-builds-list.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-10-rollout-25pct.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-11-analytics.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-12-drive-disconnected.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-13-pricing.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-14-isolation-403.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15a-admin-overview.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15b-regular-user-admin-redirect.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-16a-delete-dialog.png +0 -0
- package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-17-mobile-375.png +0 -0
- package/docs/features/e2e-full-verification/results/route-list.json +0 -1
- package/docs/features/laravel-nova-backend/ASSESSMENT-SUMMARY.md +0 -96
- package/docs/features/laravel-nova-backend/IMPLEMENTATION-PLAN.md +0 -504
- package/docs/features/laravel-nova-backend/progress-tracker.json +0 -184
- package/docs/features/live-updates.md +0 -642
- package/docs/features/queues-and-emails/00-overview.md +0 -41
- package/docs/features/queues-and-emails/00-tracker.json +0 -99
- package/docs/features/queues-and-emails/phase01-foundation.md +0 -15
- package/docs/features/queues-and-emails/phase02-queued-jobs.md +0 -19
- package/docs/features/queues-and-emails/phase03-transactional-emails.md +0 -16
- package/docs/features/queues-and-emails/phase04-quota-ops.md +0 -17
- package/docs/features/queues-and-emails/phase05-async-build-processing-DECISION.md +0 -16
- package/docs/features/queues-and-emails/phase06-verify-deploy.md +0 -17
- package/docs/getting-started/configuration.md +0 -469
- package/docs/getting-started/installation.md +0 -300
- package/docs/getting-started/quick-start.md +0 -430
- package/docs/guides/BACKEND_TEMPLATES_GUIDE.md +0 -183
- package/docs/guides/admin-panel.md +0 -268
- package/docs/guides/channel-management.md +0 -343
- package/docs/guides/dashboard-guide.md +0 -365
- package/docs/guides/deployment-guide.md +0 -335
- package/docs/guides/end-to-end-workflow.md +0 -491
- package/docs/guides/key-management.md +0 -284
- package/docs/guides/migration-from-codepush.md +0 -145
- package/docs/guides/security-best-practices.md +0 -1057
- package/docs/guides/testing-guide.md +0 -346
- package/docs/guides/troubleshooting.md +0 -482
- package/docs/package-audit.md +0 -41
- package/docs/plans/PLANNING_COMPLETE_SUMMARY.md +0 -361
- package/docs/plans/TASK_1_ANDROID_EXAMPLE_APP.md +0 -401
- package/docs/plans/TASK_2_API_ENDPOINTS.md +0 -856
- package/docs/plans/TASK_2_DASHBOARD_UI_UX.md +0 -820
- package/docs/plans/TASK_2_DATABASE_SCHEMA.md +0 -704
- package/docs/plans/TASK_2_GOOGLE_DRIVE_INTEGRATION.md +0 -646
- package/docs/plans/TASK_2_SAAS_ARCHITECTURE.md +0 -587
- package/docs/plans/TASK_2_USER_AUTHENTICATION.md +0 -600
- package/docs/play-store/ASO-METADATA.md +0 -5
- package/docs/play-store/DATA-SAFETY.md +0 -5
- package/docs/play-store/DECLARATIONS.md +0 -5
- package/docs/play-store/README.md +0 -27
- package/docs/play-store/RELEASE-NOTES.md +0 -99
- package/docs/play-store/RELEASE-STEPS.md +0 -6
- package/docs/play-store/STORE-LISTING.md +0 -7
- package/docs/play-store/SUBMISSION-CHECKLIST.md +0 -5
- package/docs/production-readiness.md +0 -475
- package/docs/project-audit/2026-05-16/00-FINALIZATION-PLAN.md +0 -123
- package/docs/project-audit/2026-05-16/01-BATCH-PLAN.md +0 -227
- package/docs/project-audit/2026-05-16/02-AUDIT-FINDINGS.md +0 -144
- package/docs/project-audit/2026-05-16/sessions/batch-01.md +0 -42
- package/docs/project-audit/2026-05-16/sessions/batch-02.md +0 -74
- package/docs/project-audit/2026-05-16/sessions/batch-03.md +0 -71
- package/docs/project-audit/2026-05-16/sessions/batch-04.md +0 -88
- package/docs/project-audit/2026-05-16/sessions/batch-05.md +0 -63
- package/docs/project-audit/2026-05-16/sessions/batch-06.md +0 -103
- package/docs/project-audit/2026-05-16/sessions/batch-07.md +0 -61
- package/docs/project-audit/2026-05-16/sessions/batch-08.md +0 -101
- package/docs/project-audit/2026-05-16/sessions/batch-09.md +0 -105
- package/docs/project-audit/2026-05-16/sessions/batch-10.md +0 -102
- package/docs/project-audit/AUDIT-HISTORY.md +0 -74
- package/docs/project-audit/BATCH-PLAN.md +0 -168
- package/docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md +0 -73
- package/docs/project-audit/PRODUCTION-READINESS-AUDIT-2026-05-08.md +0 -275
- package/docs/project-finalization/00-tracker.json +0 -60
- package/docs/project-knowledge-base/01-system-overview.md +0 -227
- package/docs/project-knowledge-base/02-routes-pages-forms-users.md +0 -352
- package/docs/project-knowledge-base/03-tech-stack-modules-services.md +0 -379
- package/docs/project-knowledge-base/04-data-models-integrations.md +0 -244
- package/docs/project-knowledge-base/05-docs-corpus-inventory.md +0 -256
- package/docs/project-knowledge-base/06-operations-testing-legal-content.md +0 -208
- package/docs/project-knowledge-base/README.md +0 -103
- package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-05-19.md +0 -81
- package/docs/reports/AUDIT_SUMMARY_2025-12-26.md +0 -203
- package/docs/reports/CLAUDE-CODE-COMPLETION-PROMPT.md +0 -403
- package/docs/reports/CLAUDE_CODE_PROMPT.md +0 -29
- package/docs/reports/CODEBASE_STATUS_REPORT.md +0 -272
- package/docs/reports/COMPLETE_VERIFICATION.md +0 -106
- package/docs/reports/COMPREHENSIVE-PROJECT-AUDIT-2026-02-24.md +0 -747
- package/docs/reports/EVENT_FLOW_VERIFICATION.md +0 -80
- package/docs/reports/EXAMPLE_APPS_SIMPLIFICATION_COMPLETE.md +0 -369
- package/docs/reports/FINAL_STATUS.md +0 -122
- package/docs/reports/FINAL_VERIFICATION_CHECKLIST.md +0 -425
- package/docs/reports/MARKETING_WEBSITE_COMPLETE.md +0 -466
- package/docs/reports/PACKAGE_COMPLETENESS_REPORT.md +0 -130
- package/docs/reports/PRODUCTION_STATUS.md +0 -115
- package/docs/reports/PROJECT_RESTRUCTURE_2025-12-27.md +0 -287
- package/docs/reports/PROJECT_RESTRUCTURE_FINAL_SUMMARY.md +0 -464
- package/docs/reports/PUBLISHING_VERIFICATION.md +0 -144
- package/docs/reports/RELEASE_READY_SUMMARY.md +0 -99
- package/docs/reports/claude-completion.json +0 -241
- package/docs/rules-tracker.md +0 -102
- package/docs/security/PRE-LAUNCH-PENTEST-CHECKLIST.md +0 -116
- package/docs/security/certificate-pinning.md +0 -122
- package/docs/seo-aeo-rules.json +0 -3043
- package/docs/social-media-marketing/README.md +0 -81
- package/docs/social-media-marketing/posts-batch-01.md +0 -613
- package/docs/social-media-marketing/posts-batch-02.md +0 -528
- package/docs/social-media-marketing/whatsapp-messages-batch-01.md +0 -458
- package/docs/social-media-marketing/whatsapp-status-batch-01.md +0 -355
- package/docs/tracking/IMPLEMENTATION_TRACKER.md +0 -303
- package/docs/tracking/capacitor-rollout-note-2026-03-01.md +0 -21
- package/docs/tracking/completion-tracker-2026-02-24.json +0 -174
- package/docs/tracking/finalization-2026-05-16-tracker.json +0 -346
- package/docs/tracking/full-audit-tracker.json +0 -121
- package/docs/tracking/production-readiness-audit-tracker.json +0 -429
- package/docs/tracking/seo-checklist-tracker.json +0 -333
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
# Background Update Feature
|
|
2
|
-
|
|
3
|
-
The Background Update feature allows your app to check for updates automatically while running in the background, providing a seamless user experience with native notifications.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
### Core Functionality
|
|
8
|
-
|
|
9
|
-
- **Background Update Checking**: Automatically check for app and live updates while the app is not active
|
|
10
|
-
- **Native Notifications**: Send native device notifications when updates are available
|
|
11
|
-
- **Configurable Intervals**: Set custom check intervals and update types
|
|
12
|
-
- **Battery Optimization**: Respect system battery saving modes and constraints
|
|
13
|
-
- **Cross-Platform**: Works on iOS (BGTaskScheduler) and Android (WorkManager)
|
|
14
|
-
|
|
15
|
-
### Platform-Specific Implementation
|
|
16
|
-
|
|
17
|
-
- **iOS**: Uses BGTaskScheduler for background tasks and UNUserNotificationCenter for notifications
|
|
18
|
-
- **Android**: Uses WorkManager for background processing and NotificationManager for notifications
|
|
19
|
-
- **Web**: Uses Notification API and intervals for fallback functionality
|
|
20
|
-
|
|
21
|
-
## Configuration
|
|
22
|
-
|
|
23
|
-
### Basic Setup
|
|
24
|
-
|
|
25
|
-
```typescript
|
|
26
|
-
import {
|
|
27
|
-
NativeUpdate,
|
|
28
|
-
BackgroundUpdateType,
|
|
29
|
-
} from 'native-update';
|
|
30
|
-
|
|
31
|
-
// Configure the plugin with background updates
|
|
32
|
-
await NativeUpdate.configure({
|
|
33
|
-
backgroundUpdate: {
|
|
34
|
-
enabled: true,
|
|
35
|
-
checkInterval: 24 * 60 * 60 * 1000, // 24 hours
|
|
36
|
-
updateTypes: [BackgroundUpdateType.BOTH],
|
|
37
|
-
autoInstall: false,
|
|
38
|
-
respectBatteryOptimization: true,
|
|
39
|
-
requireWifi: false,
|
|
40
|
-
notificationPreferences: {
|
|
41
|
-
title: 'App Update Available',
|
|
42
|
-
description: 'A new version is ready to install',
|
|
43
|
-
soundEnabled: true,
|
|
44
|
-
vibrationEnabled: true,
|
|
45
|
-
showActions: true,
|
|
46
|
-
actionLabels: {
|
|
47
|
-
updateNow: 'Update Now',
|
|
48
|
-
updateLater: 'Later',
|
|
49
|
-
dismiss: 'Not Now',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Advanced Configuration
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
// Advanced background update configuration
|
|
60
|
-
await NativeUpdate.configure({
|
|
61
|
-
backgroundUpdate: {
|
|
62
|
-
enabled: true,
|
|
63
|
-
checkInterval: 12 * 60 * 60 * 1000, // 12 hours
|
|
64
|
-
updateTypes: [
|
|
65
|
-
BackgroundUpdateType.APP_UPDATE,
|
|
66
|
-
BackgroundUpdateType.LIVE_UPDATE,
|
|
67
|
-
],
|
|
68
|
-
autoInstall: true, // Only for live updates
|
|
69
|
-
respectBatteryOptimization: true,
|
|
70
|
-
allowMeteredConnection: false,
|
|
71
|
-
minimumBatteryLevel: 20,
|
|
72
|
-
requireWifi: true,
|
|
73
|
-
maxRetries: 3,
|
|
74
|
-
retryDelay: 5000,
|
|
75
|
-
notificationPreferences: {
|
|
76
|
-
title: 'MyApp Update',
|
|
77
|
-
description: 'New features and improvements are available',
|
|
78
|
-
iconName: 'update_icon',
|
|
79
|
-
soundEnabled: true,
|
|
80
|
-
vibrationEnabled: true,
|
|
81
|
-
showActions: true,
|
|
82
|
-
channelId: 'app_updates',
|
|
83
|
-
channelName: 'App Updates',
|
|
84
|
-
priority: 'high',
|
|
85
|
-
actionLabels: {
|
|
86
|
-
updateNow: 'Install Now',
|
|
87
|
-
updateLater: 'Remind Me Later',
|
|
88
|
-
dismiss: 'Skip This Version',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
});
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## API Methods
|
|
96
|
-
|
|
97
|
-
### Enable Background Updates
|
|
98
|
-
|
|
99
|
-
```typescript
|
|
100
|
-
await NativeUpdate.enableBackgroundUpdates({
|
|
101
|
-
enabled: true,
|
|
102
|
-
checkInterval: 24 * 60 * 60 * 1000,
|
|
103
|
-
updateTypes: [BackgroundUpdateType.BOTH],
|
|
104
|
-
});
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### Disable Background Updates
|
|
108
|
-
|
|
109
|
-
```typescript
|
|
110
|
-
await NativeUpdate.disableBackgroundUpdates();
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### Get Background Update Status
|
|
114
|
-
|
|
115
|
-
```typescript
|
|
116
|
-
const status = await NativeUpdate.getBackgroundUpdateStatus();
|
|
117
|
-
console.log('Background updates enabled:', status.enabled);
|
|
118
|
-
console.log('Last check:', new Date(status.lastCheckTime));
|
|
119
|
-
console.log('Next check:', new Date(status.nextCheckTime));
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Trigger Manual Check
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
const result = await NativeUpdate.triggerBackgroundCheck();
|
|
126
|
-
if (result.updatesFound) {
|
|
127
|
-
console.log('Updates found!', result.appUpdate, result.liveUpdate);
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Configure Notifications
|
|
132
|
-
|
|
133
|
-
```typescript
|
|
134
|
-
// Set notification preferences
|
|
135
|
-
await NativeUpdate.setNotificationPreferences({
|
|
136
|
-
title: 'Custom Update Title',
|
|
137
|
-
description: 'Custom update message',
|
|
138
|
-
soundEnabled: true,
|
|
139
|
-
vibrationEnabled: true,
|
|
140
|
-
showActions: true,
|
|
141
|
-
actionLabels: {
|
|
142
|
-
updateNow: 'Install',
|
|
143
|
-
updateLater: 'Later',
|
|
144
|
-
dismiss: 'Skip',
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
// Request notification permissions
|
|
149
|
-
const granted = await NativeUpdate.requestNotificationPermissions();
|
|
150
|
-
if (granted) {
|
|
151
|
-
console.log('Notification permissions granted');
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// Check permission status
|
|
155
|
-
const permissions = await NativeUpdate.getNotificationPermissions();
|
|
156
|
-
console.log('Permissions granted:', permissions.granted);
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
## Event Listeners
|
|
160
|
-
|
|
161
|
-
### Background Update Progress
|
|
162
|
-
|
|
163
|
-
```typescript
|
|
164
|
-
NativeUpdate.addListener('backgroundUpdateProgress', (event) => {
|
|
165
|
-
console.log('Background update progress:', event.status, event.percent);
|
|
166
|
-
});
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Background Update Notifications
|
|
170
|
-
|
|
171
|
-
```typescript
|
|
172
|
-
NativeUpdate.addListener('backgroundUpdateNotification', (event) => {
|
|
173
|
-
console.log('Notification action:', event.action);
|
|
174
|
-
|
|
175
|
-
switch (event.action) {
|
|
176
|
-
case 'tapped':
|
|
177
|
-
// User tapped notification
|
|
178
|
-
break;
|
|
179
|
-
case 'update_now':
|
|
180
|
-
// User chose to update now
|
|
181
|
-
break;
|
|
182
|
-
case 'update_later':
|
|
183
|
-
// User chose to update later
|
|
184
|
-
break;
|
|
185
|
-
case 'dismiss':
|
|
186
|
-
// User dismissed notification
|
|
187
|
-
break;
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
## Platform-Specific Setup
|
|
193
|
-
|
|
194
|
-
### iOS Setup
|
|
195
|
-
|
|
196
|
-
Add to your `Info.plist`:
|
|
197
|
-
|
|
198
|
-
```xml
|
|
199
|
-
<key>UIBackgroundModes</key>
|
|
200
|
-
<array>
|
|
201
|
-
<string>background-app-refresh</string>
|
|
202
|
-
<string>background-processing</string>
|
|
203
|
-
</array>
|
|
204
|
-
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
|
205
|
-
<array>
|
|
206
|
-
<string>com.aoneahsan.nativeupdate.background</string>
|
|
207
|
-
</array>
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### Android Setup
|
|
211
|
-
|
|
212
|
-
Add to your `AndroidManifest.xml`:
|
|
213
|
-
|
|
214
|
-
```xml
|
|
215
|
-
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
|
216
|
-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
217
|
-
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
218
|
-
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
## Best Practices
|
|
222
|
-
|
|
223
|
-
### Battery Optimization
|
|
224
|
-
|
|
225
|
-
- Set `respectBatteryOptimization: true` to work within system constraints
|
|
226
|
-
- Use reasonable check intervals (not less than 15 minutes)
|
|
227
|
-
- Consider `requireWifi: true` for large updates
|
|
228
|
-
|
|
229
|
-
### User Experience
|
|
230
|
-
|
|
231
|
-
- Always request notification permissions before enabling background updates
|
|
232
|
-
- Provide clear notification messages and actions
|
|
233
|
-
- Handle notification actions appropriately
|
|
234
|
-
- Allow users to disable background updates in settings
|
|
235
|
-
|
|
236
|
-
### Performance
|
|
237
|
-
|
|
238
|
-
- Use `BackgroundUpdateType.APP_UPDATE` for critical updates only
|
|
239
|
-
- Use `BackgroundUpdateType.LIVE_UPDATE` for content updates
|
|
240
|
-
- Use `BackgroundUpdateType.BOTH` sparingly to avoid excessive battery usage
|
|
241
|
-
|
|
242
|
-
## Error Handling
|
|
243
|
-
|
|
244
|
-
```typescript
|
|
245
|
-
try {
|
|
246
|
-
await NativeUpdate.enableBackgroundUpdates(config);
|
|
247
|
-
} catch (error) {
|
|
248
|
-
console.error('Failed to enable background updates:', error);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// Listen for background update errors
|
|
252
|
-
NativeUpdate.addListener('backgroundUpdateProgress', (event) => {
|
|
253
|
-
if (event.status === 'failed' && event.error) {
|
|
254
|
-
console.error('Background update failed:', event.error);
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
## Configuration Options
|
|
260
|
-
|
|
261
|
-
### BackgroundUpdateConfig
|
|
262
|
-
|
|
263
|
-
| Option | Type | Default | Description |
|
|
264
|
-
| ---------------------------- | ---------------------- | ---------- | ----------------------------------------- |
|
|
265
|
-
| `enabled` | boolean | `false` | Enable/disable background updates |
|
|
266
|
-
| `checkInterval` | number | `86400000` | Check interval in milliseconds (24 hours) |
|
|
267
|
-
| `updateTypes` | BackgroundUpdateType[] | `['both']` | Types of updates to check for |
|
|
268
|
-
| `autoInstall` | boolean | `false` | Auto-install updates (live updates only) |
|
|
269
|
-
| `respectBatteryOptimization` | boolean | `true` | Respect system battery optimization |
|
|
270
|
-
| `allowMeteredConnection` | boolean | `false` | Allow updates on metered connections |
|
|
271
|
-
| `minimumBatteryLevel` | number | `20` | Minimum battery level (%) |
|
|
272
|
-
| `requireWifi` | boolean | `false` | Require WiFi connection |
|
|
273
|
-
| `maxRetries` | number | `3` | Maximum retry attempts |
|
|
274
|
-
| `retryDelay` | number | `5000` | Retry delay in milliseconds |
|
|
275
|
-
|
|
276
|
-
### NotificationPreferences
|
|
277
|
-
|
|
278
|
-
| Option | Type | Default | Description |
|
|
279
|
-
| ------------------ | ------- | ------------------------------ | -------------------------------- |
|
|
280
|
-
| `title` | string | `'App Update Available'` | Notification title |
|
|
281
|
-
| `description` | string | `'A new version is available'` | Notification description |
|
|
282
|
-
| `soundEnabled` | boolean | `true` | Enable notification sound |
|
|
283
|
-
| `vibrationEnabled` | boolean | `true` | Enable notification vibration |
|
|
284
|
-
| `showActions` | boolean | `true` | Show notification action buttons |
|
|
285
|
-
| `priority` | string | `'default'` | Notification priority |
|
|
286
|
-
| `actionLabels` | object | See defaults | Custom action button labels |
|
|
287
|
-
|
|
288
|
-
## Troubleshooting
|
|
289
|
-
|
|
290
|
-
### iOS Issues
|
|
291
|
-
|
|
292
|
-
- Ensure background app refresh is enabled in device settings
|
|
293
|
-
- Check that the app has notification permissions
|
|
294
|
-
- Verify BGTaskScheduler identifiers in Info.plist
|
|
295
|
-
|
|
296
|
-
### Android Issues
|
|
297
|
-
|
|
298
|
-
- Check that the app is not in battery optimization whitelist
|
|
299
|
-
- Ensure notification permissions are granted
|
|
300
|
-
- Verify WorkManager dependencies are included
|
|
301
|
-
|
|
302
|
-
### Common Issues
|
|
303
|
-
|
|
304
|
-
- Background tasks may be limited by the OS
|
|
305
|
-
- Notifications may not work without proper permissions
|
|
306
|
-
- Battery optimization can prevent background execution
|
|
307
|
-
|
|
308
|
-
## Example Implementation
|
|
309
|
-
|
|
310
|
-
```typescript
|
|
311
|
-
class BackgroundUpdateManager {
|
|
312
|
-
private isInitialized = false;
|
|
313
|
-
|
|
314
|
-
async initialize() {
|
|
315
|
-
if (this.isInitialized) return;
|
|
316
|
-
|
|
317
|
-
// Request notification permissions first
|
|
318
|
-
const granted =
|
|
319
|
-
await NativeUpdate.requestNotificationPermissions();
|
|
320
|
-
if (!granted) {
|
|
321
|
-
console.warn('Notification permissions not granted');
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// Configure background updates
|
|
326
|
-
await NativeUpdate.configure({
|
|
327
|
-
backgroundUpdate: {
|
|
328
|
-
enabled: true,
|
|
329
|
-
checkInterval: 24 * 60 * 60 * 1000, // 24 hours
|
|
330
|
-
updateTypes: [BackgroundUpdateType.BOTH],
|
|
331
|
-
autoInstall: false,
|
|
332
|
-
respectBatteryOptimization: true,
|
|
333
|
-
notificationPreferences: {
|
|
334
|
-
title: 'MyApp Update',
|
|
335
|
-
description: 'New features are available',
|
|
336
|
-
showActions: true,
|
|
337
|
-
actionLabels: {
|
|
338
|
-
updateNow: 'Install Now',
|
|
339
|
-
updateLater: 'Later',
|
|
340
|
-
dismiss: 'Skip',
|
|
341
|
-
},
|
|
342
|
-
},
|
|
343
|
-
},
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
// Set up event listeners
|
|
347
|
-
NativeUpdate.addListener(
|
|
348
|
-
'backgroundUpdateNotification',
|
|
349
|
-
(event) => {
|
|
350
|
-
this.handleNotificationAction(event.action);
|
|
351
|
-
}
|
|
352
|
-
);
|
|
353
|
-
|
|
354
|
-
this.isInitialized = true;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
private handleNotificationAction(action: string) {
|
|
358
|
-
switch (action) {
|
|
359
|
-
case 'update_now':
|
|
360
|
-
this.performUpdate();
|
|
361
|
-
break;
|
|
362
|
-
case 'update_later':
|
|
363
|
-
this.scheduleReminder();
|
|
364
|
-
break;
|
|
365
|
-
case 'dismiss':
|
|
366
|
-
this.dismissUpdate();
|
|
367
|
-
break;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
private async performUpdate() {
|
|
372
|
-
// Implement your update logic here
|
|
373
|
-
console.log('Performing update...');
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
private scheduleReminder() {
|
|
377
|
-
// Schedule a reminder for later
|
|
378
|
-
console.log('Scheduling reminder...');
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
private dismissUpdate() {
|
|
382
|
-
// Handle dismissal
|
|
383
|
-
console.log('Update dismissed');
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// Usage
|
|
388
|
-
const updateManager = new BackgroundUpdateManager();
|
|
389
|
-
await updateManager.initialize();
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
This comprehensive background update feature provides a robust solution for keeping your app updated automatically while providing excellent user experience through native notifications and proper system integration.
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Capacitor Official Plugins (R-035)
|
|
2
|
-
|
|
3
|
-
Status of official `@capacitor/*` plugins in the `website/` app (the only Capacitor consumer in this monorepo besides example-apps).
|
|
4
|
-
|
|
5
|
-
**Last verified:** 2026-04-25
|
|
6
|
-
|
|
7
|
-
## Installed
|
|
8
|
-
|
|
9
|
-
| Plugin | Status | Notes |
|
|
10
|
-
|---|---|---|
|
|
11
|
-
| `@capacitor/android` | ✅ | Platform |
|
|
12
|
-
| `@capacitor/ios` | ✅ | Platform |
|
|
13
|
-
| `@capacitor/core` | ✅ | Required |
|
|
14
|
-
| `@capacitor/cli` | ✅ | DevDep — sync/open commands |
|
|
15
|
-
| `@capacitor/motion` | ✅ | Used for parallax-style marketing-page interactions |
|
|
16
|
-
| `@capacitor/preferences` | ✅ | Used in place of localStorage where needed |
|
|
17
|
-
| `@capacitor/privacy-screen` | ✅ | Hides sensitive content during app switcher |
|
|
18
|
-
|
|
19
|
-
## Deliberately not installed
|
|
20
|
-
|
|
21
|
-
The website is a marketing site + dashboard. Many plugins from the global rule list don't apply:
|
|
22
|
-
|
|
23
|
-
| Plugin | Reason for skip |
|
|
24
|
-
|---|---|
|
|
25
|
-
| `@capacitor/app-launcher` | No deep-linking to other apps |
|
|
26
|
-
| `@capacitor/app` | Available implicitly; can be added when an explicit lifecycle handler is needed |
|
|
27
|
-
| `@capacitor/barcode-scanner` | No scanner UX |
|
|
28
|
-
| `@capacitor/browser` | All external links go through anchor `target="_blank"` — works in webview |
|
|
29
|
-
| `@capacitor/camera` | No camera feature |
|
|
30
|
-
| `@capacitor/clipboard` | Use `navigator.clipboard.writeText` (works on web + capacitor) |
|
|
31
|
-
| `@capacitor/device` | Add only if device-specific UX is required |
|
|
32
|
-
| `@capacitor/dialog` | Native confirms not needed; we use Radix dialogs |
|
|
33
|
-
| `@capacitor/geolocation` | No geo feature |
|
|
34
|
-
| `@capacitor/haptics` | Add when there's a flow that warrants haptic feedback (e.g. successful upload) |
|
|
35
|
-
| `@capacitor/network` | Add when offline state UX is implemented |
|
|
36
|
-
| `@capacitor/screen-orientation` | Web app, no orientation lock needed |
|
|
37
|
-
| `@capacitor/share` | `navigator.share` works; add native plugin if mobile share sheet is required |
|
|
38
|
-
| `@capacitor/splash-screen` | Configured via Capacitor config plugin block; no extra package needed |
|
|
39
|
-
| `@capacitor/toast` | We use Radix-based in-app toasts (`src/lib/toast.ts`) |
|
|
40
|
-
|
|
41
|
-
## Adding a new plugin (procedure)
|
|
42
|
-
|
|
43
|
-
1. Add to `website/package.json` (`yarn add @capacitor/<plugin>`).
|
|
44
|
-
2. Run `yarn cap:sync` to wire native code into Android + iOS.
|
|
45
|
-
3. Update this registry's "Installed" table.
|
|
46
|
-
4. If the plugin needs runtime permissions (camera, geolocation, contacts, etc.), update the merged manifest, privacy policy, data-safety form, and per the global rules — declare the permission AT REQUEST TIME, not at app launch.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Capawesome Plugins (R-036)
|
|
2
|
-
|
|
3
|
-
Status of `@capawesome/*` plugins in the `website/` Capacitor app.
|
|
4
|
-
|
|
5
|
-
**Last verified:** 2026-04-25
|
|
6
|
-
|
|
7
|
-
## Installed
|
|
8
|
-
|
|
9
|
-
| Plugin | Status | Notes |
|
|
10
|
-
|---|---|---|
|
|
11
|
-
| `@capawesome/capacitor-app-shortcuts` | ✅ | Long-press app icon shortcuts (e.g., "Upload bundle") |
|
|
12
|
-
|
|
13
|
-
## Pending — required before any Play Store / App Store submission
|
|
14
|
-
|
|
15
|
-
Per the global R-036 rule, these are recommended for hybrid apps targeting current Android + iOS versions. The website is not yet submitted to either store; once a store submission is planned, install and wire the items below.
|
|
16
|
-
|
|
17
|
-
| Plugin | When to add | Why |
|
|
18
|
-
|---|---|---|
|
|
19
|
-
| `@capawesome/capacitor-android-edge-to-edge-support` | Before Play Store submission | Android 15 mandates edge-to-edge layouts. |
|
|
20
|
-
| `@capawesome/capacitor-app-update` | Before stores | In-app prompt when a newer native binary exists. |
|
|
21
|
-
| `@capawesome/capacitor-app-review` | Before stores | Native review prompt at high-engagement moments. |
|
|
22
|
-
| `@capawesome/capacitor-badge` | Optional | Icon badge count — only useful with notifications. |
|
|
23
|
-
|
|
24
|
-
## Adding procedure
|
|
25
|
-
|
|
26
|
-
1. `yarn add @capawesome/<plugin>` in `website/`.
|
|
27
|
-
2. `yarn cap:sync` to wire Android + iOS.
|
|
28
|
-
3. Configure as documented at https://capawesome.io/plugins/ — most need an Android `MainActivity` registration line (auto-handled by `cap sync` for current Capacitor versions).
|
|
29
|
-
4. Update this registry.
|