@appzung/react-native-code-push 11.0.0-rc4 → 11.0.0-rc6
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/android/app/src/main/java/com/appzung/codepush/react/CodePushConstants.java +2 -0
- package/android/app/src/main/java/com/appzung/codepush/react/CodePushNativeModule.java +62 -0
- package/ios/CodePush/CodePush.h +2 -0
- package/ios/CodePush/CodePush.m +28 -0
- package/ios/CodePush/CodePushConfig.m +50 -0
- package/lib/commonjs/CodePush.js +5 -0
- package/lib/commonjs/CodePush.js.map +1 -1
- package/lib/commonjs/allowRestart.js +4 -2
- package/lib/commonjs/allowRestart.js.map +1 -1
- package/lib/commonjs/checkForUpdates.js +3 -2
- package/lib/commonjs/checkForUpdates.js.map +1 -1
- package/lib/commonjs/clearUpdates.js +4 -2
- package/lib/commonjs/clearUpdates.js.map +1 -1
- package/lib/commonjs/dataTransmission.js +28 -0
- package/lib/commonjs/dataTransmission.js.map +1 -0
- package/lib/commonjs/disallowRestart.js +4 -2
- package/lib/commonjs/disallowRestart.js.map +1 -1
- package/lib/commonjs/enums/LogLevel.enum.js +17 -0
- package/lib/commonjs/enums/LogLevel.enum.js.map +1 -0
- package/lib/commonjs/index.js +60 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internals/CodePushApiSdk.js +23 -1
- package/lib/commonjs/internals/CodePushApiSdk.js.map +1 -1
- package/lib/commonjs/internals/CodePushApiSdk.types.js.map +1 -1
- package/lib/commonjs/internals/RemotePackageImplementation.js +2 -1
- package/lib/commonjs/internals/RemotePackageImplementation.js.map +1 -1
- package/lib/commonjs/internals/logger.js +51 -0
- package/lib/commonjs/internals/logger.js.map +1 -0
- package/lib/commonjs/internals/shouldUpdateBeIgnored.js +6 -5
- package/lib/commonjs/internals/shouldUpdateBeIgnored.js.map +1 -1
- package/lib/commonjs/internals/utils/log.js +10 -3
- package/lib/commonjs/internals/utils/log.js.map +1 -1
- package/lib/commonjs/internals/utils/requestFetchAdapter.js +5 -0
- package/lib/commonjs/internals/utils/requestFetchAdapter.js.map +1 -1
- package/lib/commonjs/internals/version.js +1 -1
- package/lib/commonjs/logLevel.js +15 -0
- package/lib/commonjs/logLevel.js.map +1 -0
- package/lib/commonjs/logger.js +19 -0
- package/lib/commonjs/logger.js.map +1 -0
- package/lib/commonjs/notifyAppReady.js +17 -8
- package/lib/commonjs/notifyAppReady.js.map +1 -1
- package/lib/commonjs/restartApp.js +2 -2
- package/lib/commonjs/restartApp.js.map +1 -1
- package/lib/commonjs/sync.js +32 -27
- package/lib/commonjs/sync.js.map +1 -1
- package/lib/commonjs/telemetry.js +28 -0
- package/lib/commonjs/telemetry.js.map +1 -0
- package/lib/module/CodePush.js +5 -0
- package/lib/module/CodePush.js.map +1 -1
- package/lib/module/allowRestart.js +3 -1
- package/lib/module/allowRestart.js.map +1 -1
- package/lib/module/checkForUpdates.js +3 -2
- package/lib/module/checkForUpdates.js.map +1 -1
- package/lib/module/clearUpdates.js +3 -1
- package/lib/module/clearUpdates.js.map +1 -1
- package/lib/module/dataTransmission.js +24 -0
- package/lib/module/dataTransmission.js.map +1 -0
- package/lib/module/disallowRestart.js +3 -1
- package/lib/module/disallowRestart.js.map +1 -1
- package/lib/module/enums/LogLevel.enum.js +13 -0
- package/lib/module/enums/LogLevel.enum.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/internals/CodePushApiSdk.js +23 -1
- package/lib/module/internals/CodePushApiSdk.js.map +1 -1
- package/lib/module/internals/CodePushApiSdk.types.js.map +1 -1
- package/lib/module/internals/RemotePackageImplementation.js +2 -1
- package/lib/module/internals/RemotePackageImplementation.js.map +1 -1
- package/lib/module/internals/logger.js +44 -0
- package/lib/module/internals/logger.js.map +1 -0
- package/lib/module/internals/shouldUpdateBeIgnored.js +6 -5
- package/lib/module/internals/shouldUpdateBeIgnored.js.map +1 -1
- package/lib/module/internals/utils/log.js +11 -3
- package/lib/module/internals/utils/log.js.map +1 -1
- package/lib/module/internals/utils/requestFetchAdapter.js +5 -0
- package/lib/module/internals/utils/requestFetchAdapter.js.map +1 -1
- package/lib/module/internals/version.js +1 -1
- package/lib/module/logLevel.js +9 -0
- package/lib/module/logLevel.js.map +1 -0
- package/lib/module/logger.js +4 -0
- package/lib/module/logger.js.map +1 -0
- package/lib/module/notifyAppReady.js +17 -8
- package/lib/module/notifyAppReady.js.map +1 -1
- package/lib/module/restartApp.js +2 -2
- package/lib/module/restartApp.js.map +1 -1
- package/lib/module/sync.js +32 -27
- package/lib/module/sync.js.map +1 -1
- package/lib/module/telemetry.js +24 -0
- package/lib/module/telemetry.js.map +1 -0
- package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/allowRestart.d.ts +1 -1
- package/lib/typescript/commonjs/src/allowRestart.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/checkForUpdates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/clearUpdates.d.ts +1 -1
- package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/dataTransmission.d.ts +13 -0
- package/lib/typescript/commonjs/src/dataTransmission.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/disallowRestart.d.ts +1 -1
- package/lib/typescript/commonjs/src/disallowRestart.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts +10 -0
- package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts +3 -1
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts +2 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +4 -0
- package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/logger.d.ts +33 -0
- package/lib/typescript/commonjs/src/internals/logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/shouldUpdateBeIgnored.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/utils/log.d.ts +2 -1
- package/lib/typescript/commonjs/src/internals/utils/log.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/utils/requestFetchAdapter.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
- package/lib/typescript/commonjs/src/logLevel.d.ts +4 -0
- package/lib/typescript/commonjs/src/logLevel.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/logger.d.ts +3 -0
- package/lib/typescript/commonjs/src/logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/notifyAppReady.d.ts +2 -0
- package/lib/typescript/commonjs/src/notifyAppReady.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/restartApp.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/sync.d.ts +2 -0
- package/lib/typescript/commonjs/src/sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/telemetry.d.ts +13 -0
- package/lib/typescript/commonjs/src/telemetry.d.ts.map +1 -0
- package/lib/typescript/module/src/CodePush.d.ts.map +1 -1
- package/lib/typescript/module/src/allowRestart.d.ts +1 -1
- package/lib/typescript/module/src/allowRestart.d.ts.map +1 -1
- package/lib/typescript/module/src/checkForUpdates.d.ts.map +1 -1
- package/lib/typescript/module/src/clearUpdates.d.ts +1 -1
- package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -1
- package/lib/typescript/module/src/dataTransmission.d.ts +13 -0
- package/lib/typescript/module/src/dataTransmission.d.ts.map +1 -0
- package/lib/typescript/module/src/disallowRestart.d.ts +1 -1
- package/lib/typescript/module/src/disallowRestart.d.ts.map +1 -1
- package/lib/typescript/module/src/enums/LogLevel.enum.d.ts +10 -0
- package/lib/typescript/module/src/enums/LogLevel.enum.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +5 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts +3 -1
- package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts +2 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +4 -0
- package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/logger.d.ts +33 -0
- package/lib/typescript/module/src/internals/logger.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/shouldUpdateBeIgnored.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/utils/log.d.ts +2 -1
- package/lib/typescript/module/src/internals/utils/log.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/utils/requestFetchAdapter.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/version.d.ts +1 -1
- package/lib/typescript/module/src/logLevel.d.ts +4 -0
- package/lib/typescript/module/src/logLevel.d.ts.map +1 -0
- package/lib/typescript/module/src/logger.d.ts +3 -0
- package/lib/typescript/module/src/logger.d.ts.map +1 -0
- package/lib/typescript/module/src/notifyAppReady.d.ts +2 -0
- package/lib/typescript/module/src/notifyAppReady.d.ts.map +1 -1
- package/lib/typescript/module/src/restartApp.d.ts.map +1 -1
- package/lib/typescript/module/src/sync.d.ts +2 -0
- package/lib/typescript/module/src/sync.d.ts.map +1 -1
- package/lib/typescript/module/src/telemetry.d.ts +13 -0
- package/lib/typescript/module/src/telemetry.d.ts.map +1 -0
- package/package.json +23 -14
- package/scripts/generateBundledResourcesHash.js +73 -68
- package/scripts/getFilesInFolder.js +12 -12
- package/scripts/recordFilesBeforeBundleCommand.js +19 -20
- package/src/CodePush.tsx +6 -0
- package/src/allowRestart.ts +3 -1
- package/src/checkForUpdates.ts +3 -2
- package/src/clearUpdates.ts +3 -1
- package/src/dataTransmission.ts +21 -0
- package/src/disallowRestart.ts +3 -1
- package/src/enums/LogLevel.enum.ts +9 -0
- package/src/index.ts +5 -0
- package/src/internals/CodePushApiSdk.ts +27 -0
- package/src/internals/CodePushApiSdk.types.ts +2 -0
- package/src/internals/RNAppZungCodePushModuleSpec.ts +6 -0
- package/src/internals/RemotePackageImplementation.ts +2 -1
- package/src/internals/logger.ts +46 -0
- package/src/internals/shouldUpdateBeIgnored.ts +6 -5
- package/src/internals/utils/log.ts +13 -3
- package/src/internals/utils/requestFetchAdapter.ts +8 -0
- package/src/internals/version.ts +1 -1
- package/src/logLevel.ts +9 -0
- package/src/logger.ts +2 -0
- package/src/notifyAppReady.ts +19 -7
- package/src/restartApp.ts +2 -2
- package/src/sync.ts +38 -26
- package/src/telemetry.ts +21 -0
- package/docs/advanced-usage.md +0 -71
- package/docs/api-android.md +0 -22
- package/docs/api-ios.md +0 -19
- package/docs/api-js/README.md +0 -55
- package/docs/api-js/enumerations/CheckFrequency.md +0 -33
- package/docs/api-js/enumerations/DeploymentStatus.md +0 -25
- package/docs/api-js/enumerations/InstallMode.md +0 -50
- package/docs/api-js/enumerations/SyncStatus.md +0 -85
- package/docs/api-js/enumerations/UpdateState.md +0 -37
- package/docs/api-js/functions/allowRestart.md +0 -17
- package/docs/api-js/functions/checkForUpdate.md +0 -29
- package/docs/api-js/functions/clearUpdates.md +0 -19
- package/docs/api-js/functions/disallowRestart.md +0 -17
- package/docs/api-js/functions/getClientUniqueId.md +0 -15
- package/docs/api-js/functions/getUpdateMetadata.md +0 -23
- package/docs/api-js/functions/notifyAppReady.md +0 -17
- package/docs/api-js/functions/resetClientUniqueId.md +0 -15
- package/docs/api-js/functions/restartApp.md +0 -25
- package/docs/api-js/functions/sync.md +0 -43
- package/docs/api-js/functions/withCodePush.md +0 -65
- package/docs/api-js/interfaces/CodePushOptions.md +0 -118
- package/docs/api-js/interfaces/DownloadProgress.md +0 -23
- package/docs/api-js/interfaces/LocalPackage.md +0 -171
- package/docs/api-js/interfaces/Package.md +0 -98
- package/docs/api-js/interfaces/RemotePackage.md +0 -169
- package/docs/api-js/interfaces/RollbackRetryOptions.md +0 -28
- package/docs/api-js/interfaces/StatusReport.md +0 -47
- package/docs/api-js/interfaces/SyncOptions.md +0 -80
- package/docs/api-js/interfaces/UpdateDialog.md +0 -89
- package/docs/api-js/type-aliases/DownloadProgressCallback.md +0 -21
- package/docs/api-js/type-aliases/HandleBinaryVersionMismatchCallback.md +0 -23
- package/docs/api-js/type-aliases/SyncStatusChangedCallback.md +0 -23
- package/docs/api-js/variables/DEFAULT_UPDATE_DIALOG.md +0 -12
- package/docs/code-signing.md +0 -64
- package/docs/migrating-to-v10.md +0 -31
- package/docs/setup-android.md +0 -80
- package/docs/setup-ios.md +0 -108
- package/docs/setup-windows.md +0 -55
- package/typedoc.json +0 -9
package/src/logLevel.ts
ADDED
package/src/logger.ts
ADDED
package/src/notifyAppReady.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AppState, type NativeEventSubscription } from 'react-native';
|
|
2
|
+
import { LogLevel } from './enums/LogLevel.enum';
|
|
2
3
|
import { CodePushApiSdk } from './internals/CodePushApiSdk';
|
|
3
4
|
import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePushModule';
|
|
4
5
|
import { getConfiguration } from './internals/getConfiguration';
|
|
@@ -7,6 +8,8 @@ import { requestFetchAdapter } from './internals/utils/requestFetchAdapter';
|
|
|
7
8
|
import type { StatusReport } from './types';
|
|
8
9
|
|
|
9
10
|
/**
|
|
11
|
+
* @function
|
|
12
|
+
*
|
|
10
13
|
* Notifies the CodePush runtime that an installed update is considered successful.
|
|
11
14
|
*
|
|
12
15
|
* If you are manually checking for and installing updates (i.e. not using the `sync` method to handle it all for you), then this method **MUST** be called; otherwise CodePush will treat the update as failed and rollback to the previous version when the app next restarts.
|
|
@@ -26,9 +29,17 @@ export const notifyAppReady = (() => {
|
|
|
26
29
|
})();
|
|
27
30
|
|
|
28
31
|
async function notifyApplicationReadyInternal() {
|
|
32
|
+
log(LogLevel.DEBUG, 'notifyApplicationReady');
|
|
33
|
+
|
|
29
34
|
await NativeRNAppZungCodePushModule.notifyApplicationReady();
|
|
30
35
|
const statusReport = await NativeRNAppZungCodePushModule.getNewStatusReport();
|
|
31
|
-
|
|
36
|
+
if (statusReport) {
|
|
37
|
+
log(LogLevel.DEBUG, `tryReportStatus ${statusReport.status || '(no update)'}`);
|
|
38
|
+
|
|
39
|
+
tryReportStatus(statusReport); // Don't wait for this to complete.
|
|
40
|
+
} else {
|
|
41
|
+
log(LogLevel.DEBUG, `Nothing to report`);
|
|
42
|
+
}
|
|
32
43
|
|
|
33
44
|
return statusReport;
|
|
34
45
|
}
|
|
@@ -39,13 +50,13 @@ async function tryReportStatus(statusReport: StatusReport, retryOnAppResume?: Na
|
|
|
39
50
|
const previousReleaseChannelPublicId = statusReport.previousReleaseChannelPublicId || config.releaseChannelPublicId;
|
|
40
51
|
try {
|
|
41
52
|
if (statusReport.appVersion) {
|
|
42
|
-
log(`Reporting binary update (${statusReport.appVersion})`);
|
|
53
|
+
log(LogLevel.INFO, `Reporting binary update (${statusReport.appVersion})`);
|
|
43
54
|
|
|
44
55
|
if (!config.releaseChannelPublicId) {
|
|
45
56
|
throw new Error('Release channel is missing');
|
|
46
57
|
}
|
|
47
58
|
|
|
48
|
-
const sdk = new CodePushApiSdk(requestFetchAdapter, config);
|
|
59
|
+
const sdk = new CodePushApiSdk(requestFetchAdapter, log, config);
|
|
49
60
|
await sdk.reportStatusDeploy(null, previousLabelOrAppVersion, previousReleaseChannelPublicId);
|
|
50
61
|
} else {
|
|
51
62
|
if (!statusReport.package) {
|
|
@@ -54,14 +65,14 @@ async function tryReportStatus(statusReport: StatusReport, retryOnAppResume?: Na
|
|
|
54
65
|
|
|
55
66
|
const label = statusReport.package.label;
|
|
56
67
|
if (statusReport.status === 'DeploymentSucceeded') {
|
|
57
|
-
log(`Reporting CodePush update success (${label})`);
|
|
68
|
+
log(LogLevel.INFO, `Reporting CodePush update success (${label})`);
|
|
58
69
|
} else {
|
|
59
|
-
log(`Reporting CodePush update rollback (${label})`);
|
|
70
|
+
log(LogLevel.INFO, `Reporting CodePush update rollback (${label})`);
|
|
60
71
|
await NativeRNAppZungCodePushModule.setLatestRollbackInfo(statusReport.package.packageHash);
|
|
61
72
|
}
|
|
62
73
|
|
|
63
74
|
config.releaseChannelPublicId = statusReport.package.releaseChannelPublicId;
|
|
64
|
-
const sdk = new CodePushApiSdk(requestFetchAdapter, config);
|
|
75
|
+
const sdk = new CodePushApiSdk(requestFetchAdapter, log, config);
|
|
65
76
|
await sdk.reportStatusDeploy(
|
|
66
77
|
{
|
|
67
78
|
package: statusReport.package,
|
|
@@ -75,7 +86,7 @@ async function tryReportStatus(statusReport: StatusReport, retryOnAppResume?: Na
|
|
|
75
86
|
NativeRNAppZungCodePushModule.recordStatusReported(statusReport);
|
|
76
87
|
retryOnAppResume && retryOnAppResume.remove();
|
|
77
88
|
} catch (e) {
|
|
78
|
-
log(`Report status failed: ${JSON.stringify(statusReport)}`);
|
|
89
|
+
log(LogLevel.WARN, `Report status failed: ${JSON.stringify(statusReport)}`);
|
|
79
90
|
NativeRNAppZungCodePushModule.saveStatusReportForRetry(statusReport);
|
|
80
91
|
// Try again when the app resumes
|
|
81
92
|
if (!retryOnAppResume) {
|
|
@@ -83,6 +94,7 @@ async function tryReportStatus(statusReport: StatusReport, retryOnAppResume?: Na
|
|
|
83
94
|
if (newState !== 'active') return;
|
|
84
95
|
const refreshedStatusReport = await NativeRNAppZungCodePushModule.getNewStatusReport();
|
|
85
96
|
if (refreshedStatusReport) {
|
|
97
|
+
log(LogLevel.DEBUG, `tryReportStatus on active appState ${statusReport.status || '(no update)'}`);
|
|
86
98
|
tryReportStatus(refreshedStatusReport, resumeListener);
|
|
87
99
|
} else {
|
|
88
100
|
resumeListener && resumeListener.remove();
|
package/src/restartApp.ts
CHANGED
|
@@ -7,6 +7,6 @@ import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePu
|
|
|
7
7
|
*
|
|
8
8
|
* @param onlyIfUpdateIsPending Indicates whether you want the restart to no-op if there isn't currently a pending update.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
11
|
-
NativeRNAppZungCodePushModule.restartApp(onlyIfUpdateIsPending);
|
|
10
|
+
export function restartApp(onlyIfUpdateIsPending = false) {
|
|
11
|
+
return NativeRNAppZungCodePushModule.restartApp(onlyIfUpdateIsPending);
|
|
12
12
|
}
|
package/src/sync.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Alert, type AlertButton, Platform } from 'react-native';
|
|
2
2
|
import { checkForUpdate } from './checkForUpdates';
|
|
3
3
|
import { InstallMode } from './enums/InstallMode.enum';
|
|
4
|
+
import { LogLevel } from './enums/LogLevel.enum';
|
|
4
5
|
import { SyncStatus } from './enums/SyncStatus.enum';
|
|
5
6
|
import { getCurrentPackage } from './internals/getCurrentPackage';
|
|
6
7
|
import { shouldUpdateBeIgnored } from './internals/shouldUpdateBeIgnored';
|
|
@@ -62,38 +63,39 @@ async function syncInternal(
|
|
|
62
63
|
: (syncStatus: SyncStatus) => {
|
|
63
64
|
switch (syncStatus) {
|
|
64
65
|
case SyncStatus.CHECKING_FOR_UPDATE:
|
|
65
|
-
log('Checking for update.');
|
|
66
|
+
log(LogLevel.INFO, 'Checking for update.');
|
|
66
67
|
break;
|
|
67
68
|
case SyncStatus.AWAITING_USER_ACTION:
|
|
68
|
-
log('Awaiting user action.');
|
|
69
|
+
log(LogLevel.INFO, 'Awaiting user action.');
|
|
69
70
|
break;
|
|
70
71
|
case SyncStatus.DOWNLOADING_PACKAGE:
|
|
71
|
-
log('Downloading package.');
|
|
72
|
+
log(LogLevel.INFO, 'Downloading package.');
|
|
72
73
|
break;
|
|
73
74
|
case SyncStatus.INSTALLING_UPDATE:
|
|
74
|
-
log('Installing update.');
|
|
75
|
+
log(LogLevel.INFO, 'Installing update.');
|
|
75
76
|
break;
|
|
76
77
|
case SyncStatus.UP_TO_DATE:
|
|
77
|
-
log('App is up to date.');
|
|
78
|
+
log(LogLevel.INFO, 'App is up to date.');
|
|
78
79
|
break;
|
|
79
80
|
case SyncStatus.UPDATE_IGNORED:
|
|
80
|
-
log('User cancelled the update.');
|
|
81
|
+
log(LogLevel.INFO, 'User cancelled the update.');
|
|
81
82
|
break;
|
|
82
83
|
case SyncStatus.UPDATE_INSTALLED:
|
|
83
|
-
if (resolvedInstallMode
|
|
84
|
-
log('Update is installed and will be run on the next app restart.');
|
|
85
|
-
} else if (resolvedInstallMode
|
|
86
|
-
if (
|
|
84
|
+
if (resolvedInstallMode === InstallMode.ON_NEXT_RESTART) {
|
|
85
|
+
log(LogLevel.INFO, 'Update is installed and will be run on the next app restart.');
|
|
86
|
+
} else if (resolvedInstallMode === InstallMode.ON_NEXT_RESUME) {
|
|
87
|
+
if (syncOptions.minimumBackgroundDuration) {
|
|
87
88
|
log(
|
|
89
|
+
LogLevel.INFO,
|
|
88
90
|
`Update is installed and will be run after the app has been in the background for at least ${syncOptions.minimumBackgroundDuration} seconds.`,
|
|
89
91
|
);
|
|
90
92
|
} else {
|
|
91
|
-
log('Update is installed and will be run when the app next resumes.');
|
|
93
|
+
log(LogLevel.INFO, 'Update is installed and will be run when the app next resumes.');
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
break;
|
|
95
97
|
case SyncStatus.UNKNOWN_ERROR:
|
|
96
|
-
log('An unknown error occurred.');
|
|
98
|
+
log(LogLevel.ERROR, 'An unknown error occurred.');
|
|
97
99
|
break;
|
|
98
100
|
}
|
|
99
101
|
};
|
|
@@ -127,7 +129,10 @@ async function syncInternal(
|
|
|
127
129
|
|
|
128
130
|
if (!remotePackage || updateShouldBeIgnored) {
|
|
129
131
|
if (updateShouldBeIgnored) {
|
|
130
|
-
log(
|
|
132
|
+
log(
|
|
133
|
+
LogLevel.INFO,
|
|
134
|
+
'An update is available, but it is being ignored due to having been previously rolled back.',
|
|
135
|
+
);
|
|
131
136
|
}
|
|
132
137
|
|
|
133
138
|
const currentPackage = await getCurrentPackage();
|
|
@@ -195,6 +200,7 @@ async function syncInternal(
|
|
|
195
200
|
} catch (error) {
|
|
196
201
|
syncStatusChangeCallback(SyncStatus.UNKNOWN_ERROR);
|
|
197
202
|
log(
|
|
203
|
+
LogLevel.ERROR,
|
|
198
204
|
error != null && typeof error === 'object' && 'message' in error && typeof error.message === 'string'
|
|
199
205
|
? error.message
|
|
200
206
|
: 'Unknown',
|
|
@@ -204,6 +210,8 @@ async function syncInternal(
|
|
|
204
210
|
}
|
|
205
211
|
|
|
206
212
|
/**
|
|
213
|
+
* @function
|
|
214
|
+
*
|
|
207
215
|
* Allows checking for an update, downloading it and installing it, all with a single call.
|
|
208
216
|
*
|
|
209
217
|
* Unless you need custom UI and/or behavior, we recommend most developers to use this method when integrating CodePush into their apps, if they are not using the `withCodePush` HOC.
|
|
@@ -228,25 +236,29 @@ export const sync = (() => {
|
|
|
228
236
|
downloadProgressCallback?: DownloadProgressCallback,
|
|
229
237
|
handleBinaryVersionMismatchCallback?: HandleBinaryVersionMismatchCallback,
|
|
230
238
|
): Promise<SyncStatus> => {
|
|
231
|
-
|
|
232
|
-
let downloadProgressCallbackWithTryCatch: DownloadProgressCallback | undefined;
|
|
239
|
+
log(LogLevel.DEBUG, `sync start`);
|
|
233
240
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
}
|
|
241
|
+
let syncStatusCallbackWithTryCatch: SyncStatusChangedCallback = (status) => {
|
|
242
|
+
log(LogLevel.DEBUG, `sync status ${SyncStatus[status]}`);
|
|
243
|
+
|
|
244
|
+
if (typeof syncStatusChangedCallback !== 'function') {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
243
247
|
|
|
248
|
+
try {
|
|
249
|
+
syncStatusChangedCallback(status);
|
|
250
|
+
} catch (error) {
|
|
251
|
+
log(LogLevel.ERROR, `An error has occurred : ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
let downloadProgressCallbackWithTryCatch: DownloadProgressCallback | undefined;
|
|
244
256
|
if (typeof downloadProgressCallback === 'function') {
|
|
245
257
|
downloadProgressCallbackWithTryCatch = (...args) => {
|
|
246
258
|
try {
|
|
247
259
|
downloadProgressCallback(...args);
|
|
248
260
|
} catch (error) {
|
|
249
|
-
log(`An error has occurred: ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
261
|
+
log(LogLevel.ERROR, `An error has occurred: ${error instanceof Error ? error.stack : 'unknown'}`);
|
|
250
262
|
}
|
|
251
263
|
};
|
|
252
264
|
}
|
|
@@ -254,7 +266,7 @@ export const sync = (() => {
|
|
|
254
266
|
if (syncInProgress) {
|
|
255
267
|
typeof syncStatusCallbackWithTryCatch === 'function'
|
|
256
268
|
? syncStatusCallbackWithTryCatch(SyncStatus.SYNC_IN_PROGRESS)
|
|
257
|
-
: log('Sync already in progress.');
|
|
269
|
+
: log(LogLevel.WARN, 'Sync already in progress.');
|
|
258
270
|
return Promise.resolve(SyncStatus.SYNC_IN_PROGRESS);
|
|
259
271
|
}
|
|
260
272
|
|
package/src/telemetry.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePushModule';
|
|
2
|
+
import { reloadCachedConfiguration } from './internals/getConfiguration';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Controls telemetry reporting.
|
|
6
|
+
*
|
|
7
|
+
* @param enabled - When false, updates on this device will stop appearing as failed, pending or succeeded in analytics.
|
|
8
|
+
*/
|
|
9
|
+
export async function setTelemetryEnabled(enabled: boolean): Promise<void> {
|
|
10
|
+
await NativeRNAppZungCodePushModule.setTelemetryEnabled(enabled);
|
|
11
|
+
await reloadCachedConfiguration();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Gets the current telemetry enabled status.
|
|
16
|
+
*
|
|
17
|
+
* When setTelemetryEnabled has never been enabled, returns the default value set in your configuration.
|
|
18
|
+
*/
|
|
19
|
+
export function getTelemetryEnabled(): Promise<boolean> {
|
|
20
|
+
return NativeRNAppZungCodePushModule.getTelemetryEnabled();
|
|
21
|
+
}
|
package/docs/advanced-usage.md
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
## Advanced usage
|
|
2
|
-
|
|
3
|
-
### Multiple environments
|
|
4
|
-
|
|
5
|
-
#### Staging / Production
|
|
6
|
-
|
|
7
|
-
In a real-world scenario you would have `Staging` and `Production` apps that are different binaries, each using specific environment config (different package name, bundle identifier, API, feature flags etc). Create a release channel for each of these environments with `appzung release-channels create` and change the `CodePushReleaseChannelPublicId` on the native side with environment variables. You might want to use a module like [react-native-config](https://github.com/lugg/react-native-config) (or do it manually using build variants and configurations).
|
|
8
|
-
|
|
9
|
-
```groovy
|
|
10
|
-
// android/app/build.gradle
|
|
11
|
-
android {
|
|
12
|
-
// ...
|
|
13
|
-
defaultConfig {
|
|
14
|
-
// ...
|
|
15
|
-
resValue 'string', "CodePushReleaseChannelPublicId", project.env.get("CODEPUSH_RELEASE_CHANNEL_PUBLIC_ID_ANDROID")
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
// ios/myapp/Info.plist
|
|
22
|
-
|
|
23
|
-
<key>CodePushReleaseChannelPublicId</key>
|
|
24
|
-
<string>$(CODEPUSH_RELEASE_CHANNEL_PUBLIC_ID_IOS)</string>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
#### QA / Production
|
|
28
|
-
|
|
29
|
-
In the case where you have a `QA` environment that is completely iso-prod (meaning you can swap the JS bundle between those two apps), you may take advantage of the `promote` feature:
|
|
30
|
-
|
|
31
|
-
1. Release a CodePush update to your `QA` release channel using the `appzung releases deploy-react-native` command (or `appzung releases deploy` if you need more control)
|
|
32
|
-
2. Let QA test the build
|
|
33
|
-
3. Promote the tested release from `QA` to `Production` using the `appzung releases promote` command
|
|
34
|
-
|
|
35
|
-
_NOTE: If you want to take a more cautious approach, you can even choose to perform a "staged rollout" as part of #3, which allows you to mitigate additional potential risk with the update (like did your testing in #2 touch all possible devices/conditions?) by only making the production update available to a percentage of your users (for example `appzung releases promote -r 20`). Then, after waiting for a reasonable amount of time to see if any crash reports or customer feedback comes in, you can expand it to your entire audience by running `appzung releases edit -r 100`._
|
|
36
|
-
|
|
37
|
-
### Dynamic release channel assignment
|
|
38
|
-
|
|
39
|
-
The above section illustrated how you can leverage multiple CodePush release channels in order to effectively test your updates before broadly releasing them to your end users. However, since that workflow statically embeds the release channel assignment into the actual binary, a staging or production build will only ever sync updates from that release channel. In many cases, this is sufficient, since you only want your team, customers, stakeholders, etc. to sync with your pre-production releases, and therefore, only they need a build that knows how to sync with staging. However, if you want to be able to perform A/B tests, or provide early access of your app to certain users, it can prove very useful to be able to dynamically place specific users (or audiences) into specific release channels at runtime.
|
|
40
|
-
|
|
41
|
-
In order to achieve this kind of workflow, all you need to do is specify the release channel public ID you want the current user to synchronize with when calling the `codePush` method. When specified, this key will override the "default" one that was provided in your app's `Info.plist` (iOS) or strings resources (Android) files. This allows you to produce a build for staging or production, that is also capable of being dynamically "redirected" as needed.
|
|
42
|
-
|
|
43
|
-
```javascript
|
|
44
|
-
// Imagine that "userProfile" is a prop that this component received
|
|
45
|
-
// which includes the release channel public ID that the current user should use.
|
|
46
|
-
codePush.sync({ releaseChannelPublicId: userProfile.RELEASE_CHANNEL_PUBLIC_ID });
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
With that change in place, now it's just a matter of choosing how your app determines the right release channel for the current user. In practice, there are typically two solutions for this:
|
|
50
|
-
|
|
51
|
-
1. Expose a user-visible mechanism for changing release channels at any time. For example, your settings page could have a toggle for enabling "beta" access. This model works well if you're not concerned with the privacy of your pre-production updates, and you have power users that may want to opt-in to earlier (and potentially buggy) updates at their own will (kind of like Chrome channels). However, this solution puts the decision in the hands of your users, which doesn't help you perform A/B tests transparently.
|
|
52
|
-
2. Annotate the server-side profile of your users with an additional piece of metadata that indicates the release channel they should sync with. By default, your app could just use the binary-embedded key, but after a user has authenticated, your server can choose to "redirect" them to a different release channel, which allows you to incrementally place certain users or groups in different release channels as needed. You could even choose to store the server-response in local storage so that it becomes the new default. How you store the key alongside your user's profiles is entirely up to your authentication solution (for example Auth0, Firebase, custom DB + REST API), but is generally pretty trivial to do.
|
|
53
|
-
|
|
54
|
-
_NOTE: If needed, you could also implement a hybrid solution that allowed your end-users to toggle between different release channels, while also allowing your server to override that decision. This way, you have a hierarchy of "release channel resolution" that ensures your app has the ability to update itself out-of-the-box, your end users can feel rewarded by getting early access to bits, but you also have the ability to run A/B tests on your users as needed._
|
|
55
|
-
|
|
56
|
-
Are you using dynamic release channel assignments? Contact us at hello@appzung.com so that we may provide better integration.
|
|
57
|
-
|
|
58
|
-
### Using a custom server URL
|
|
59
|
-
|
|
60
|
-
This module lets you change the targeted CodePush server URL, this can be used by:
|
|
61
|
-
|
|
62
|
-
- People who use a self-hosted basic CodePush server like the open source Microsoft's code-push-server. Note that you won't be able to use most features of AppZung with these self-hosted servers. We're committed to keep this module compatible with the basic CodePush features so that our users are not locked in.
|
|
63
|
-
- Enterprise clients with a custom AppZung infrastructure
|
|
64
|
-
|
|
65
|
-
#### iOS
|
|
66
|
-
|
|
67
|
-
Add a `CodePushServerURL` in the `Info.plist` targeting your code-push server.
|
|
68
|
-
|
|
69
|
-
#### Android
|
|
70
|
-
|
|
71
|
-
Add a `CodePushServerUrl` in your strings resources targeting your code-push server.
|
package/docs/api-android.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
## Java API reference (Android)
|
|
2
|
-
|
|
3
|
-
You can customize CodePush by placing these values in string resources.
|
|
4
|
-
|
|
5
|
-
- **Release channel Public ID** - The default release channel's **public ID** that will be used to check updates. For example:
|
|
6
|
-
|
|
7
|
-
```xml
|
|
8
|
-
<string moduleConfig="true" name="CodePushReleaseChannelPublicId">sU0Eikse9JFCDLZmAT-_lUSwDWACrSGgTKCXyWqcE0</string>
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
- **Public Key** - used for bundle verification in the Code Signing Feature. Please refer to [Code Signing](setup-android.md#code-signing-setup) section for more details about the Code Signing Feature.
|
|
12
|
-
To set the public key, you should add the content of the public key to `strings.xml` with name `CodePushSigningPublicKey`. CodePush automatically gets this property and enables the Code Signing feature. For example:
|
|
13
|
-
|
|
14
|
-
```xml
|
|
15
|
-
<string moduleConfig="true" name="CodePushSigningPublicKey">your-public-key</string>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
- **Server Url** - used for specifying CodePush Server Url (as an Enterprise customer we may setup a custom infra for your needs).
|
|
19
|
-
The Default value: "https://codepush.appzung.com/" is overridden by adding your path to `strings.xml` with name `CodePushServerUrl`. CodePush automatically gets this property and will use this path to send requests. For example:
|
|
20
|
-
```xml
|
|
21
|
-
<string moduleConfig="true" name="CodePushServerUrl">https://codepush.yourdomain.com</string>
|
|
22
|
-
```
|
package/docs/api-ios.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
## Objective-C API reference (iOS)
|
|
2
|
-
|
|
3
|
-
The Objective-C API is made available by importing the `CodePush.h` header into your `AppDelegate.m` file, and consists of a single public class named `CodePush`.
|
|
4
|
-
|
|
5
|
-
### CodePush
|
|
6
|
-
|
|
7
|
-
Contains static methods for retrieving the `NSURL` that represents the most recent JavaScript bundle file, and can be passed to the `RCTRootView`'s `initWithBundleURL` method when bootstrapping your app in the `AppDelegate.m` file.
|
|
8
|
-
|
|
9
|
-
#### Methods
|
|
10
|
-
|
|
11
|
-
- **(NSURL \*)bundleURL** - Returns the most recent JS bundle `NSURL` as described above. This method assumes that the name of the JS bundle contained within your app binary is `main.jsbundle`.
|
|
12
|
-
|
|
13
|
-
- **(NSURL \*)bundleURLForResource:(NSString \*)resourceName** - Equivalent to the `bundleURL` method, but also allows customizing the name of the JS bundle that is looked for within the app binary. This is useful if you aren't naming this file `main` (which is the default convention). This method assumes that the JS bundle's extension is `*.jsbundle`.
|
|
14
|
-
|
|
15
|
-
- **(NSURL \*)bundleURLForResource:(NSString \*)resourceName withExtension:(NSString \*)resourceExtension**: Equivalent to the `bundleURLForResource:` method, but also allows customizing the extension used by the JS bundle that is looked for within the app binary. This is useful if you aren't naming this file `*.jsbundle` (which is the default convention).
|
|
16
|
-
|
|
17
|
-
- **(void)overrideAppVersion:(NSString \*)appVersionOverride** - Sets the version of the application's binary interface, which would otherwise default to the App Store version specified as the `CFBundleShortVersionString` in the `Info.plist`. This should be called a single time, before the bundle URL is loaded.
|
|
18
|
-
|
|
19
|
-
- **(void)setReleaseChannelPublicId:(NSString \*)releaseChannelPublicId** - Sets the release channel public ID that the app should use when querying for updates. This is a dynamic alternative to setting the release channel in your `Info.plist` and/or specifying a release channel in JS when calling `checkForUpdate` or `sync`.
|
package/docs/api-js/README.md
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
**@appzung/react-native-code-push v11.0.0-rc4**
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# @appzung/react-native-code-push v11.0.0-rc4
|
|
6
|
-
|
|
7
|
-
## Enumerations
|
|
8
|
-
|
|
9
|
-
- [CheckFrequency](enumerations/CheckFrequency.md)
|
|
10
|
-
- [DeploymentStatus](enumerations/DeploymentStatus.md)
|
|
11
|
-
- [InstallMode](enumerations/InstallMode.md)
|
|
12
|
-
- [SyncStatus](enumerations/SyncStatus.md)
|
|
13
|
-
- [UpdateState](enumerations/UpdateState.md)
|
|
14
|
-
|
|
15
|
-
## Interfaces
|
|
16
|
-
|
|
17
|
-
- [CodePushOptions](interfaces/CodePushOptions.md)
|
|
18
|
-
- [DownloadProgress](interfaces/DownloadProgress.md)
|
|
19
|
-
- [LocalPackage](interfaces/LocalPackage.md)
|
|
20
|
-
- [Package](interfaces/Package.md)
|
|
21
|
-
- [RemotePackage](interfaces/RemotePackage.md)
|
|
22
|
-
- [RollbackRetryOptions](interfaces/RollbackRetryOptions.md)
|
|
23
|
-
- [StatusReport](interfaces/StatusReport.md)
|
|
24
|
-
- [SyncOptions](interfaces/SyncOptions.md)
|
|
25
|
-
- [UpdateDialog](interfaces/UpdateDialog.md)
|
|
26
|
-
|
|
27
|
-
## Type Aliases
|
|
28
|
-
|
|
29
|
-
- [DownloadProgressCallback](type-aliases/DownloadProgressCallback.md)
|
|
30
|
-
- [HandleBinaryVersionMismatchCallback](type-aliases/HandleBinaryVersionMismatchCallback.md)
|
|
31
|
-
- [SyncStatusChangedCallback](type-aliases/SyncStatusChangedCallback.md)
|
|
32
|
-
|
|
33
|
-
## Variables
|
|
34
|
-
|
|
35
|
-
- [DEFAULT_UPDATE_DIALOG](variables/DEFAULT_UPDATE_DIALOG.md)
|
|
36
|
-
|
|
37
|
-
## Functions
|
|
38
|
-
|
|
39
|
-
- [allowRestart](functions/allowRestart.md)
|
|
40
|
-
- [checkForUpdate](functions/checkForUpdate.md)
|
|
41
|
-
- [clearUpdates](functions/clearUpdates.md)
|
|
42
|
-
- [disallowRestart](functions/disallowRestart.md)
|
|
43
|
-
- [getClientUniqueId](functions/getClientUniqueId.md)
|
|
44
|
-
- [getUpdateMetadata](functions/getUpdateMetadata.md)
|
|
45
|
-
- [notifyAppReady](functions/notifyAppReady.md)
|
|
46
|
-
- [resetClientUniqueId](functions/resetClientUniqueId.md)
|
|
47
|
-
- [restartApp](functions/restartApp.md)
|
|
48
|
-
- [sync](functions/sync.md)
|
|
49
|
-
- [withCodePush](functions/withCodePush.md)
|
|
50
|
-
|
|
51
|
-
## References
|
|
52
|
-
|
|
53
|
-
### default
|
|
54
|
-
|
|
55
|
-
Renames and re-exports [withCodePush](functions/withCodePush.md)
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
[**@appzung/react-native-code-push v11.0.0-rc4**](../README.md)
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
[@appzung/react-native-code-push](../README.md) / CheckFrequency
|
|
6
|
-
|
|
7
|
-
# Enumeration: CheckFrequency
|
|
8
|
-
|
|
9
|
-
Indicates when you would like to check for (and install) updates from the CodePush server.
|
|
10
|
-
|
|
11
|
-
## Enumeration Members
|
|
12
|
-
|
|
13
|
-
### MANUAL
|
|
14
|
-
|
|
15
|
-
> **MANUAL**: `2`
|
|
16
|
-
|
|
17
|
-
Don't automatically check for updates, but only do it when `sync()` is manually called in app code.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
### ON_APP_RESUME
|
|
22
|
-
|
|
23
|
-
> **ON_APP_RESUME**: `1`
|
|
24
|
-
|
|
25
|
-
When the app re-enters the foreground after being "backgrounded" (user pressed the home button, app launches a separate payment process, etc.)
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
### ON_APP_START
|
|
30
|
-
|
|
31
|
-
> **ON_APP_START**: `0`
|
|
32
|
-
|
|
33
|
-
When the app is fully initialized (or more specifically, when the root component is mounted).
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
[**@appzung/react-native-code-push v11.0.0-rc4**](../README.md)
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
[@appzung/react-native-code-push](../README.md) / DeploymentStatus
|
|
6
|
-
|
|
7
|
-
# Enumeration: DeploymentStatus
|
|
8
|
-
|
|
9
|
-
Indicates the status of a deployment (after installing and restarting).
|
|
10
|
-
|
|
11
|
-
## Enumeration Members
|
|
12
|
-
|
|
13
|
-
### FAILED
|
|
14
|
-
|
|
15
|
-
> **FAILED**: `"DeploymentFailed"`
|
|
16
|
-
|
|
17
|
-
The deployment failed (and was rolled back).
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
### SUCCEEDED
|
|
22
|
-
|
|
23
|
-
> **SUCCEEDED**: `"DeploymentSucceeded"`
|
|
24
|
-
|
|
25
|
-
The deployment succeeded.
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
[**@appzung/react-native-code-push v11.0.0-rc4**](../README.md)
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
[@appzung/react-native-code-push](../README.md) / InstallMode
|
|
6
|
-
|
|
7
|
-
# Enumeration: InstallMode
|
|
8
|
-
|
|
9
|
-
Indicates when you would like an installed update to actually be applied.
|
|
10
|
-
|
|
11
|
-
## Enumeration Members
|
|
12
|
-
|
|
13
|
-
### IMMEDIATE
|
|
14
|
-
|
|
15
|
-
> **IMMEDIATE**: `number`
|
|
16
|
-
|
|
17
|
-
Indicates that you want to install the update and restart the app immediately.
|
|
18
|
-
|
|
19
|
-
This value is appropriate for debugging scenarios as well as when displaying an update prompt to the user, since they would expect to see the changes immediately after accepting the installation. Additionally, this mode can be used to enforce mandatory updates, since it removes the potentially undesired latency between the update installation and the next time the end user restarts or resumes the app.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
### ON_NEXT_RESTART
|
|
24
|
-
|
|
25
|
-
> **ON_NEXT_RESTART**: `number`
|
|
26
|
-
|
|
27
|
-
Indicates that you want to install the update, but not forcibly restart the app.
|
|
28
|
-
|
|
29
|
-
When the app is "naturally" restarted (due the OS or end user killing it), the update will be seamlessly picked up. This value is appropriate when performing silent updates, since it would likely be disruptive to the end user if the app suddenly restarted out of nowhere, since they wouldn't have realized an update was even downloaded. This is the default mode used for both the `sync` and `LocalPackage.install` methods.
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
### ON_NEXT_RESUME
|
|
34
|
-
|
|
35
|
-
> **ON_NEXT_RESUME**: `number`
|
|
36
|
-
|
|
37
|
-
Indicates that you want to install the update, but don't want to restart the app until the next time the end user resumes it from the background.
|
|
38
|
-
|
|
39
|
-
This way, you don't disrupt their current session,but you can get the update in front of them sooner than having to wait for the next natural restart.
|
|
40
|
-
This value is appropriate for silent installs that can be applied on resume in a non-invasive way.
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
### ON_NEXT_SUSPEND
|
|
45
|
-
|
|
46
|
-
> **ON_NEXT_SUSPEND**: `number`
|
|
47
|
-
|
|
48
|
-
Indicates that you want to install the update when the app is in the background,
|
|
49
|
-
but only after it has been in the background for "minimumBackgroundDuration" seconds (0 by default),
|
|
50
|
-
so that user context isn't lost unless the app suspension is long enough to not matter.
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
[**@appzung/react-native-code-push v11.0.0-rc4**](../README.md)
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
[@appzung/react-native-code-push](../README.md) / SyncStatus
|
|
6
|
-
|
|
7
|
-
# Enumeration: SyncStatus
|
|
8
|
-
|
|
9
|
-
Indicates the current status of a sync operation.
|
|
10
|
-
|
|
11
|
-
## Enumeration Members
|
|
12
|
-
|
|
13
|
-
### AWAITING_USER_ACTION
|
|
14
|
-
|
|
15
|
-
> **AWAITING_USER_ACTION**: `6`
|
|
16
|
-
|
|
17
|
-
An update is available, and a confirmation dialog was shown
|
|
18
|
-
to the end user. (This is only applicable when the `updateDialog` is used)
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
### CHECKING_FOR_UPDATE
|
|
23
|
-
|
|
24
|
-
> **CHECKING_FOR_UPDATE**: `5`
|
|
25
|
-
|
|
26
|
-
The CodePush server is being queried for an update.
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
### DOWNLOADING_PACKAGE
|
|
31
|
-
|
|
32
|
-
> **DOWNLOADING_PACKAGE**: `7`
|
|
33
|
-
|
|
34
|
-
An available update is being downloaded from the CodePush server.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
### INSTALLING_UPDATE
|
|
39
|
-
|
|
40
|
-
> **INSTALLING_UPDATE**: `8`
|
|
41
|
-
|
|
42
|
-
An available update was downloaded and is about to be installed.
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
### SYNC_IN_PROGRESS
|
|
47
|
-
|
|
48
|
-
> **SYNC_IN_PROGRESS**: `4`
|
|
49
|
-
|
|
50
|
-
There is an ongoing `sync` operation running which prevents the current call from being executed.
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
### UNKNOWN_ERROR
|
|
55
|
-
|
|
56
|
-
> **UNKNOWN_ERROR**: `3`
|
|
57
|
-
|
|
58
|
-
The `sync` operation encountered an unknown error.
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
### UP_TO_DATE
|
|
63
|
-
|
|
64
|
-
> **UP_TO_DATE**: `0`
|
|
65
|
-
|
|
66
|
-
The app is fully up-to-date with the configured release channel.
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
### UPDATE_IGNORED
|
|
71
|
-
|
|
72
|
-
> **UPDATE_IGNORED**: `2`
|
|
73
|
-
|
|
74
|
-
The app had an optional update which the end user chose to ignore.
|
|
75
|
-
(This is only applicable when the `updateDialog` is used)
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
### UPDATE_INSTALLED
|
|
80
|
-
|
|
81
|
-
> **UPDATE_INSTALLED**: `1`
|
|
82
|
-
|
|
83
|
-
An available update has been installed and will be run either immediately after the
|
|
84
|
-
`syncStatusChangedCallback` function returns or the next time the app resumes/restarts,
|
|
85
|
-
depending on the `InstallMode` specified in `SyncOptions`
|