native-update 1.0.1 → 1.0.2

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.
@@ -106,20 +106,38 @@ async function onTaskCompleted() {
106
106
  ## Configuration Options
107
107
 
108
108
  ```typescript
109
- // Initialize with custom configuration
110
- NativeUpdate.configure({
111
- // Live update settings
112
- autoCheckOnStart: true,
113
- updateCheckInterval: 3600000, // 1 hour
114
- updateChannel: 'production',
115
-
116
- // Security settings
117
- enableSignatureVerification: true,
118
- publicKey: 'your-public-key',
119
-
120
- // App review settings
121
- minimumDaysSinceInstall: 3,
122
- minimumDaysSinceLastPrompt: 30
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
- liveUpdate: {
28
- appId: 'com.yourcompany.app',
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
- appUpdate: {
35
- checkOnAppStart: true,
36
- minimumVersion: '1.0.0',
37
- },
38
- appReview: {
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.1",
3
+ "version": "1.0.2",
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",