native-update 1.0.1 → 1.0.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/dist/esm/core/plugin-manager.js +8 -3
- package/dist/esm/core/plugin-manager.js.map +1 -1
- package/dist/esm/definitions.d.ts +1 -1
- package/dist/esm/plugin.js +22 -5
- package/dist/esm/plugin.js.map +1 -1
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.esm.js +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/docs/examples/basic-usage.md +32 -14
- package/docs/getting-started/quick-start.md +10 -11
- package/package.json +1 -1
|
@@ -106,20 +106,38 @@ async function onTaskCompleted() {
|
|
|
106
106
|
## Configuration Options
|
|
107
107
|
|
|
108
108
|
```typescript
|
|
109
|
-
//
|
|
110
|
-
NativeUpdate.configure({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
109
|
+
// Option 1: Direct configuration (auto-initializes if not already initialized)
|
|
110
|
+
await NativeUpdate.configure({
|
|
111
|
+
config: {
|
|
112
|
+
// Live update settings
|
|
113
|
+
autoUpdate: true,
|
|
114
|
+
updateCheckInterval: 3600000, // 1 hour
|
|
115
|
+
updateChannel: 'production',
|
|
116
|
+
|
|
117
|
+
// Security settings
|
|
118
|
+
enableSignatureVerification: true,
|
|
119
|
+
publicKey: 'your-public-key',
|
|
120
|
+
|
|
121
|
+
// App review settings
|
|
122
|
+
minimumDaysSinceInstall: 3,
|
|
123
|
+
minimumDaysSinceLastPrompt: 30
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Option 2: Explicit initialization (if you need more control)
|
|
128
|
+
await NativeUpdate.initialize({
|
|
129
|
+
config: {
|
|
130
|
+
autoUpdate: true,
|
|
131
|
+
updateChannel: 'production'
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// Later, you can update configuration
|
|
136
|
+
await NativeUpdate.configure({
|
|
137
|
+
config: {
|
|
138
|
+
updateChannel: 'staging',
|
|
139
|
+
autoUpdate: false
|
|
140
|
+
}
|
|
123
141
|
});
|
|
124
142
|
```
|
|
125
143
|
|
|
@@ -24,21 +24,20 @@ import { NativeUpdate } from 'native-update';
|
|
|
24
24
|
// Initialize the plugin with your configuration
|
|
25
25
|
async function initializeUpdates() {
|
|
26
26
|
await NativeUpdate.configure({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
serverUrl: 'https://updates.yourserver.com',
|
|
30
|
-
channel: 'production',
|
|
27
|
+
config: {
|
|
28
|
+
// Live update settings
|
|
31
29
|
autoUpdate: true,
|
|
30
|
+
updateChannel: 'production',
|
|
32
31
|
updateStrategy: 'IMMEDIATE',
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
|
|
33
|
+
// Security settings
|
|
34
|
+
enableSignatureVerification: true,
|
|
35
|
+
publicKey: 'your-public-key',
|
|
36
|
+
|
|
37
|
+
// App review settings
|
|
39
38
|
minimumDaysSinceInstall: 7,
|
|
40
39
|
minimumLaunchCount: 3,
|
|
41
|
-
}
|
|
40
|
+
}
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
43
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-update",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Foundation package for building a comprehensive update system for Capacitor apps. Provides architecture and interfaces but requires backend implementation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|