@appzung/react-native-code-push 11.0.0-rc5 → 11.0.0-rc7
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/CodePush.podspec +3 -5
- package/README.md +1 -1
- 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 +10 -6
- package/ios/CodePush/{CodePush.m → CodePush.mm} +126 -142
- package/ios/CodePush/CodePushConfig.m +50 -0
- package/ios/CodePush.xcodeproj/project.pbxproj +6 -6
- 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 +1 -1
- 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 +3 -0
- package/lib/commonjs/enums/LogLevel.enum.js.map +1 -1
- package/lib/commonjs/index.js +36 -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/CodePushEventEmitter.js +10 -0
- package/lib/commonjs/internals/CodePushEventEmitter.js.map +1 -0
- package/lib/commonjs/internals/RemotePackageImplementation.js +2 -3
- 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/utils/log.js +4 -2
- package/lib/commonjs/internals/utils/log.js.map +1 -1
- package/lib/commonjs/internals/version.js +1 -1
- package/lib/commonjs/logger.js +19 -0
- package/lib/commonjs/logger.js.map +1 -0
- package/lib/commonjs/notifyAppReady.js +4 -2
- 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 +5 -3
- 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.map +1 -1
- package/lib/module/allowRestart.js +3 -1
- package/lib/module/allowRestart.js.map +1 -1
- package/lib/module/checkForUpdates.js +1 -1
- 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 +3 -0
- package/lib/module/enums/LogLevel.enum.js.map +1 -1
- package/lib/module/index.js +3 -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/CodePushEventEmitter.js +6 -0
- package/lib/module/internals/CodePushEventEmitter.js.map +1 -0
- package/lib/module/internals/RemotePackageImplementation.js +2 -3
- 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/utils/log.js +4 -2
- package/lib/module/internals/utils/log.js.map +1 -1
- package/lib/module/internals/version.js +1 -1
- package/lib/module/logger.js +4 -0
- package/lib/module/logger.js.map +1 -0
- package/lib/module/notifyAppReady.js +4 -2
- 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 +5 -3
- 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 +2 -2
- 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/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 +3 -0
- package/lib/typescript/commonjs/src/enums/LogLevel.enum.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +3 -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/CodePushEventEmitter.d.ts +3 -0
- package/lib/typescript/commonjs/src/internals/CodePushEventEmitter.d.ts.map +1 -0
- 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/utils/log.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
- package/lib/typescript/commonjs/src/logLevel.d.ts.map +1 -1
- 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 +2 -2
- 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/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 +3 -0
- package/lib/typescript/module/src/enums/LogLevel.enum.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +3 -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/CodePushEventEmitter.d.ts +3 -0
- package/lib/typescript/module/src/internals/CodePushEventEmitter.d.ts.map +1 -0
- 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/utils/log.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/version.d.ts +1 -1
- package/lib/typescript/module/src/logLevel.d.ts.map +1 -1
- 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 +4 -2
- package/src/allowRestart.ts +3 -1
- package/src/checkForUpdates.ts +1 -1
- package/src/clearUpdates.ts +3 -1
- package/src/dataTransmission.ts +21 -0
- package/src/disallowRestart.ts +3 -1
- package/src/enums/LogLevel.enum.ts +3 -0
- package/src/index.ts +3 -0
- package/src/internals/CodePushApiSdk.ts +27 -0
- package/src/internals/CodePushApiSdk.types.ts +2 -0
- package/src/internals/CodePushEventEmitter.ts +4 -0
- package/src/internals/RNAppZungCodePushModuleSpec.ts +6 -0
- package/src/internals/RemotePackageImplementation.ts +2 -3
- package/src/internals/logger.ts +46 -0
- package/src/internals/utils/log.ts +4 -2
- package/src/internals/version.ts +1 -1
- package/src/logger.ts +2 -0
- package/src/notifyAppReady.ts +4 -2
- package/src/restartApp.ts +2 -2
- package/src/sync.ts +5 -3
- 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 -58
- 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/LogLevel.md +0 -31
- 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/getLogLevel.md +0 -13
- 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/setLogLevel.md +0 -19
- 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/clearUpdates.ts
CHANGED
|
@@ -7,4 +7,6 @@ import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePu
|
|
|
7
7
|
* Note: we don’t recommend using this method in scenarios other than that (CodePush will call
|
|
8
8
|
* this method automatically when needed in other cases) as it could lead to unpredictable behavior.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export function clearUpdates() {
|
|
11
|
+
return NativeRNAppZungCodePushModule.clearUpdates();
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePushModule';
|
|
2
|
+
import { reloadCachedConfiguration } from './internals/getConfiguration';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Controls data transmission for CodePush. This may be used for privacy optIn.
|
|
6
|
+
*
|
|
7
|
+
* @param enabled - When false, disables all external API calls to CodePush servers. Checking for updates will be disabled.
|
|
8
|
+
*/
|
|
9
|
+
export async function setDataTransmissionEnabled(enabled: boolean): Promise<void> {
|
|
10
|
+
await NativeRNAppZungCodePushModule.setDataTransmissionEnabled(enabled);
|
|
11
|
+
await reloadCachedConfiguration();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Gets the current data transmission status.
|
|
16
|
+
*
|
|
17
|
+
* When setDataTransmissionEnabled has never been called, returns the default value set in your configuration.
|
|
18
|
+
*/
|
|
19
|
+
export function getDataTransmissionEnabled(): Promise<boolean> {
|
|
20
|
+
return NativeRNAppZungCodePushModule.getDataTransmissionEnabled();
|
|
21
|
+
}
|
package/src/disallowRestart.ts
CHANGED
|
@@ -5,4 +5,6 @@ import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePu
|
|
|
5
5
|
*
|
|
6
6
|
* This is an advanced API, and is useful when a component within your app (for example an onboarding process) needs to ensure that no end-user interruptions can occur during its lifetime.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export function disallowRestart() {
|
|
9
|
+
return NativeRNAppZungCodePushModule.disallow();
|
|
10
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -11,6 +11,9 @@ export * from './sync';
|
|
|
11
11
|
export * from './getClientUniqueId';
|
|
12
12
|
export * from './resetClientUniqueId';
|
|
13
13
|
export * from './logLevel';
|
|
14
|
+
export * from './logger';
|
|
15
|
+
export * from './telemetry';
|
|
16
|
+
export * from './dataTransmission';
|
|
14
17
|
|
|
15
18
|
export * from './types';
|
|
16
19
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LogLevel } from '../enums/LogLevel.enum';
|
|
1
2
|
import { CodePushError, CodePushHttpError } from './CodePushApiSdk.errors';
|
|
2
3
|
import {
|
|
3
4
|
type ApiSdkConfiguration,
|
|
@@ -22,6 +23,7 @@ export class CodePushApiSdk {
|
|
|
22
23
|
|
|
23
24
|
constructor(
|
|
24
25
|
private readonly httpRequester: Http.Requester,
|
|
26
|
+
private readonly log: (level: LogLevel, message: string) => void,
|
|
25
27
|
configuration: ApiSdkConfiguration,
|
|
26
28
|
) {
|
|
27
29
|
this.configuration = { ...configuration };
|
|
@@ -34,6 +36,11 @@ export class CodePushApiSdk {
|
|
|
34
36
|
async queryUpdateWithCurrentPackage(
|
|
35
37
|
currentPackageInfo: ApiSdkQueryUpdatePackageInfo,
|
|
36
38
|
): Promise<ApiSdkRemotePackage | ApiSdkNativeUpdateNotification | null> {
|
|
39
|
+
if (!this.configuration.dataTransmissionEnabled) {
|
|
40
|
+
this.log(LogLevel.DEBUG, 'Skipped querying for update because data transmission is disabled');
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
37
44
|
const query: CheckUpdateRequestInput = {
|
|
38
45
|
deployment_key: this.configuration.releaseChannelPublicId,
|
|
39
46
|
app_version: currentPackageInfo.appVersion,
|
|
@@ -86,6 +93,16 @@ export class CodePushApiSdk {
|
|
|
86
93
|
previousLabelOrAppVersion: string | null,
|
|
87
94
|
previousDeploymentKey: string | null,
|
|
88
95
|
): Promise<void> {
|
|
96
|
+
if (!this.configuration.dataTransmissionEnabled) {
|
|
97
|
+
this.log(LogLevel.DEBUG, 'Skipped reporting deploy status because data transmission is disabled');
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (!this.configuration.telemetryEnabled) {
|
|
102
|
+
this.log(LogLevel.DEBUG, 'Skipped reporting deploy status because telemetry is disabled');
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
89
106
|
const requestBody: ReportDeployInput = {
|
|
90
107
|
app_version: this.configuration.appVersion,
|
|
91
108
|
deployment_key: this.configuration.releaseChannelPublicId,
|
|
@@ -116,6 +133,16 @@ export class CodePushApiSdk {
|
|
|
116
133
|
}
|
|
117
134
|
|
|
118
135
|
async reportStatusDownload(downloadedPackage: ApiSdkDownloadReportPackageInfo): Promise<void> {
|
|
136
|
+
if (!this.configuration.dataTransmissionEnabled) {
|
|
137
|
+
this.log(LogLevel.DEBUG, 'Skipped reporting download because data transmission is disabled');
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (!this.configuration.telemetryEnabled) {
|
|
142
|
+
this.log(LogLevel.DEBUG, 'Skipped reporting download because telemetry is disabled');
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
119
146
|
const requestBody: ReportDownloadInput = {
|
|
120
147
|
client_unique_id: this.configuration.clientUniqueId,
|
|
121
148
|
deployment_key: this.configuration.releaseChannelPublicId,
|
|
@@ -52,4 +52,10 @@ export interface Spec extends TurboModule {
|
|
|
52
52
|
|
|
53
53
|
isFirstRun(packageHash: string): Promise<boolean>;
|
|
54
54
|
isFailedUpdate(packageHash: string): Promise<boolean>;
|
|
55
|
+
|
|
56
|
+
setTelemetryEnabled(enabled: boolean): Promise<void>;
|
|
57
|
+
getTelemetryEnabled(): Promise<boolean>;
|
|
58
|
+
|
|
59
|
+
setDataTransmissionEnabled(enabled: boolean): Promise<void>;
|
|
60
|
+
getDataTransmissionEnabled(): Promise<boolean>;
|
|
55
61
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NativeEventEmitter } from 'react-native';
|
|
2
1
|
import { LogLevel } from '../enums/LogLevel.enum';
|
|
3
2
|
import type { DownloadProgressCallback, LocalPackage, RemotePackage } from '../types';
|
|
4
3
|
import type { ApiSdkDownloadReportPackageInfo } from './CodePushApiSdk.types';
|
|
4
|
+
import { CodePushEventEmitter } from './CodePushEventEmitter';
|
|
5
5
|
import { LocalPackageImplementation } from './LocalPackageImplementation';
|
|
6
6
|
import { NativeRNAppZungCodePushModule } from './NativeRNAppZungCodePushModule';
|
|
7
7
|
import { log } from './utils/log';
|
|
@@ -21,9 +21,8 @@ export class RemotePackageImpl implements RemotePackage {
|
|
|
21
21
|
let downloadProgressSubscription;
|
|
22
22
|
|
|
23
23
|
if (downloadProgressCallback) {
|
|
24
|
-
const codePushEventEmitter = new NativeEventEmitter(NativeRNAppZungCodePushModule);
|
|
25
24
|
// Use event subscription to obtain download progress.
|
|
26
|
-
downloadProgressSubscription =
|
|
25
|
+
downloadProgressSubscription = CodePushEventEmitter.addListener(
|
|
27
26
|
'CodePushDownloadProgress',
|
|
28
27
|
downloadProgressCallback,
|
|
29
28
|
);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { LogLevel } from '../enums/LogLevel.enum';
|
|
2
|
+
|
|
3
|
+
export type LoggerFunction = (level: LogLevel, message: string) => void;
|
|
4
|
+
|
|
5
|
+
const defaultLogger: LoggerFunction = (_level: LogLevel, message: string): void => {
|
|
6
|
+
console.log(`[CodePush] ${message}`);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
let currentLogger: LoggerFunction = defaultLogger;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Set a custom logger function to handle all CodePush logs
|
|
13
|
+
*
|
|
14
|
+
* @param logger A function that takes a log level and message and handles the logging
|
|
15
|
+
* @example
|
|
16
|
+
* ```
|
|
17
|
+
* import { setLogger, LogLevel } from '@appzung/react-native-code-push';
|
|
18
|
+
*
|
|
19
|
+
* // Custom logger that sends critical logs to a crash reporting service
|
|
20
|
+
* setLogger((level, message) => {
|
|
21
|
+
* // Always log to console
|
|
22
|
+
* console.log(`[CodePush] ${message}`);
|
|
23
|
+
*
|
|
24
|
+
* // Send error logs to crash reporting
|
|
25
|
+
* if (level === LogLevel.ERROR) {
|
|
26
|
+
* MyCrashReportingService.log(`CodePush error: ${message}`);
|
|
27
|
+
* }
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export const setLogger = (logger: LoggerFunction): void => {
|
|
32
|
+
currentLogger = logger;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get the current logger function
|
|
37
|
+
* @returns The current logger function
|
|
38
|
+
*/
|
|
39
|
+
export const getLogger = (): LoggerFunction => currentLogger;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Reset the logger to the default implementation
|
|
43
|
+
*/
|
|
44
|
+
export const resetLogger = (): void => {
|
|
45
|
+
currentLogger = defaultLogger;
|
|
46
|
+
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { LogLevel } from '../../enums/LogLevel.enum';
|
|
2
2
|
import { getLogLevel } from '../../logLevel';
|
|
3
|
+
import { getLogger } from '../logger';
|
|
3
4
|
|
|
4
|
-
/* Logs messages
|
|
5
|
+
/* Logs messages using the configured logger */
|
|
5
6
|
export function log(level: LogLevel, message: string): void {
|
|
6
7
|
const currentLogLevel = getLogLevel();
|
|
7
8
|
if (level < currentLogLevel) {
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
const logger = getLogger();
|
|
13
|
+
logger(level, message);
|
|
12
14
|
}
|
package/src/internals/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '11.0.0-
|
|
2
|
+
export const version = '11.0.0-rc7';
|
package/src/logger.ts
ADDED
package/src/notifyAppReady.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { requestFetchAdapter } from './internals/utils/requestFetchAdapter';
|
|
|
8
8
|
import type { StatusReport } from './types';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
+
* @function
|
|
12
|
+
*
|
|
11
13
|
* Notifies the CodePush runtime that an installed update is considered successful.
|
|
12
14
|
*
|
|
13
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.
|
|
@@ -54,7 +56,7 @@ async function tryReportStatus(statusReport: StatusReport, retryOnAppResume?: Na
|
|
|
54
56
|
throw new Error('Release channel is missing');
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
const sdk = new CodePushApiSdk(requestFetchAdapter, config);
|
|
59
|
+
const sdk = new CodePushApiSdk(requestFetchAdapter, log, config);
|
|
58
60
|
await sdk.reportStatusDeploy(null, previousLabelOrAppVersion, previousReleaseChannelPublicId);
|
|
59
61
|
} else {
|
|
60
62
|
if (!statusReport.package) {
|
|
@@ -70,7 +72,7 @@ async function tryReportStatus(statusReport: StatusReport, retryOnAppResume?: Na
|
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
config.releaseChannelPublicId = statusReport.package.releaseChannelPublicId;
|
|
73
|
-
const sdk = new CodePushApiSdk(requestFetchAdapter, config);
|
|
75
|
+
const sdk = new CodePushApiSdk(requestFetchAdapter, log, config);
|
|
74
76
|
await sdk.reportStatusDeploy(
|
|
75
77
|
{
|
|
76
78
|
package: statusReport.package,
|
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
|
@@ -81,10 +81,10 @@ async function syncInternal(
|
|
|
81
81
|
log(LogLevel.INFO, 'User cancelled the update.');
|
|
82
82
|
break;
|
|
83
83
|
case SyncStatus.UPDATE_INSTALLED:
|
|
84
|
-
if (resolvedInstallMode
|
|
84
|
+
if (resolvedInstallMode === InstallMode.ON_NEXT_RESTART) {
|
|
85
85
|
log(LogLevel.INFO, 'Update is installed and will be run on the next app restart.');
|
|
86
|
-
} else if (resolvedInstallMode
|
|
87
|
-
if (
|
|
86
|
+
} else if (resolvedInstallMode === InstallMode.ON_NEXT_RESUME) {
|
|
87
|
+
if (syncOptions.minimumBackgroundDuration) {
|
|
88
88
|
log(
|
|
89
89
|
LogLevel.INFO,
|
|
90
90
|
`Update is installed and will be run after the app has been in the background for at least ${syncOptions.minimumBackgroundDuration} seconds.`,
|
|
@@ -210,6 +210,8 @@ async function syncInternal(
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
|
+
* @function
|
|
214
|
+
*
|
|
213
215
|
* Allows checking for an update, downloading it and installing it, all with a single call.
|
|
214
216
|
*
|
|
215
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.
|
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,58 +0,0 @@
|
|
|
1
|
-
**@appzung/react-native-code-push v11.0.0-rc5**
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# @appzung/react-native-code-push v11.0.0-rc5
|
|
6
|
-
|
|
7
|
-
## Enumerations
|
|
8
|
-
|
|
9
|
-
- [CheckFrequency](enumerations/CheckFrequency.md)
|
|
10
|
-
- [DeploymentStatus](enumerations/DeploymentStatus.md)
|
|
11
|
-
- [InstallMode](enumerations/InstallMode.md)
|
|
12
|
-
- [LogLevel](enumerations/LogLevel.md)
|
|
13
|
-
- [SyncStatus](enumerations/SyncStatus.md)
|
|
14
|
-
- [UpdateState](enumerations/UpdateState.md)
|
|
15
|
-
|
|
16
|
-
## Interfaces
|
|
17
|
-
|
|
18
|
-
- [CodePushOptions](interfaces/CodePushOptions.md)
|
|
19
|
-
- [DownloadProgress](interfaces/DownloadProgress.md)
|
|
20
|
-
- [LocalPackage](interfaces/LocalPackage.md)
|
|
21
|
-
- [Package](interfaces/Package.md)
|
|
22
|
-
- [RemotePackage](interfaces/RemotePackage.md)
|
|
23
|
-
- [RollbackRetryOptions](interfaces/RollbackRetryOptions.md)
|
|
24
|
-
- [StatusReport](interfaces/StatusReport.md)
|
|
25
|
-
- [SyncOptions](interfaces/SyncOptions.md)
|
|
26
|
-
- [UpdateDialog](interfaces/UpdateDialog.md)
|
|
27
|
-
|
|
28
|
-
## Type Aliases
|
|
29
|
-
|
|
30
|
-
- [DownloadProgressCallback](type-aliases/DownloadProgressCallback.md)
|
|
31
|
-
- [HandleBinaryVersionMismatchCallback](type-aliases/HandleBinaryVersionMismatchCallback.md)
|
|
32
|
-
- [SyncStatusChangedCallback](type-aliases/SyncStatusChangedCallback.md)
|
|
33
|
-
|
|
34
|
-
## Variables
|
|
35
|
-
|
|
36
|
-
- [DEFAULT_UPDATE_DIALOG](variables/DEFAULT_UPDATE_DIALOG.md)
|
|
37
|
-
|
|
38
|
-
## Functions
|
|
39
|
-
|
|
40
|
-
- [allowRestart](functions/allowRestart.md)
|
|
41
|
-
- [checkForUpdate](functions/checkForUpdate.md)
|
|
42
|
-
- [clearUpdates](functions/clearUpdates.md)
|
|
43
|
-
- [disallowRestart](functions/disallowRestart.md)
|
|
44
|
-
- [getClientUniqueId](functions/getClientUniqueId.md)
|
|
45
|
-
- [getLogLevel](functions/getLogLevel.md)
|
|
46
|
-
- [getUpdateMetadata](functions/getUpdateMetadata.md)
|
|
47
|
-
- [notifyAppReady](functions/notifyAppReady.md)
|
|
48
|
-
- [resetClientUniqueId](functions/resetClientUniqueId.md)
|
|
49
|
-
- [restartApp](functions/restartApp.md)
|
|
50
|
-
- [setLogLevel](functions/setLogLevel.md)
|
|
51
|
-
- [sync](functions/sync.md)
|
|
52
|
-
- [withCodePush](functions/withCodePush.md)
|
|
53
|
-
|
|
54
|
-
## References
|
|
55
|
-
|
|
56
|
-
### default
|
|
57
|
-
|
|
58
|
-
Renames and re-exports [withCodePush](functions/withCodePush.md)
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
[**@appzung/react-native-code-push v11.0.0-rc5**](../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-rc5**](../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-rc5**](../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,31 +0,0 @@
|
|
|
1
|
-
[**@appzung/react-native-code-push v11.0.0-rc5**](../README.md)
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
[@appzung/react-native-code-push](../README.md) / LogLevel
|
|
6
|
-
|
|
7
|
-
# Enumeration: LogLevel
|
|
8
|
-
|
|
9
|
-
## Enumeration Members
|
|
10
|
-
|
|
11
|
-
### DEBUG
|
|
12
|
-
|
|
13
|
-
> **DEBUG**: `0`
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
### ERROR
|
|
18
|
-
|
|
19
|
-
> **ERROR**: `3`
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
### INFO
|
|
24
|
-
|
|
25
|
-
> **INFO**: `1`
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
### WARN
|
|
30
|
-
|
|
31
|
-
> **WARN**: `2`
|