@appzung/react-native-code-push 10.0.1 → 10.1.1
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/README.md +3 -3
- package/android/app/src/main/java/com/appzung/codepush/react/CodePush.java +3 -0
- package/android/app/src/main/java/com/appzung/codepush/react/CodePushNativeModule.java +14 -0
- package/ios/CodePush/CodePush.h +1 -0
- package/ios/CodePush/CodePush.m +64 -13
- package/ios/CodePush/CodePushConfig.m +4 -0
- package/lib/commonjs/CodePush.js +6 -2
- package/lib/commonjs/CodePush.js.map +1 -1
- package/lib/commonjs/allowRestart.js +2 -0
- package/lib/commonjs/allowRestart.js.map +1 -1
- package/lib/commonjs/checkForUpdates.js +23 -25
- package/lib/commonjs/checkForUpdates.js.map +1 -1
- package/lib/commonjs/clearUpdates.js +2 -1
- package/lib/commonjs/clearUpdates.js.map +1 -1
- package/lib/commonjs/disallowRestart.js +2 -0
- package/lib/commonjs/disallowRestart.js.map +1 -1
- package/lib/commonjs/enums/CheckFrequency.enum.js +2 -2
- package/lib/commonjs/enums/InstallMode.enum.js +7 -3
- package/lib/commonjs/enums/InstallMode.enum.js.map +1 -1
- package/lib/commonjs/enums/SyncStatus.enum.js +7 -7
- package/lib/commonjs/enums/UpdateState.enum.js +7 -6
- package/lib/commonjs/enums/UpdateState.enum.js.map +1 -1
- package/lib/commonjs/getClientUniqueId.js +16 -0
- package/lib/commonjs/getClientUniqueId.js.map +1 -0
- package/lib/commonjs/index.js +34 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internals/CodePushApiSdk.errors.js +26 -0
- package/lib/commonjs/internals/CodePushApiSdk.errors.js.map +1 -0
- package/lib/commonjs/internals/CodePushApiSdk.js +100 -0
- package/lib/commonjs/internals/CodePushApiSdk.js.map +1 -0
- package/lib/commonjs/{enums/DeploymentStatus.enum.js → internals/CodePushApiSdk.types.js} +3 -2
- package/lib/commonjs/internals/CodePushApiSdk.types.js.map +1 -0
- package/lib/commonjs/internals/RemotePackageImplementation.js +6 -5
- package/lib/commonjs/internals/RemotePackageImplementation.js.map +1 -1
- package/lib/commonjs/internals/getConfiguration.js +4 -0
- package/lib/commonjs/internals/getConfiguration.js.map +1 -1
- package/lib/commonjs/internals/utils/fetchRetry.js +59 -0
- package/lib/commonjs/internals/utils/fetchRetry.js.map +1 -0
- package/lib/commonjs/internals/utils/queryStringify.js +25 -0
- package/lib/commonjs/internals/utils/queryStringify.js.map +1 -0
- package/lib/commonjs/internals/utils/requestFetchAdapter.js +33 -0
- package/lib/commonjs/internals/utils/requestFetchAdapter.js.map +1 -0
- package/lib/commonjs/internals/version.js +1 -1
- package/lib/commonjs/notifyAppReady.js +11 -9
- package/lib/commonjs/notifyAppReady.js.map +1 -1
- package/lib/commonjs/resetClientUniqueId.js +18 -0
- package/lib/commonjs/resetClientUniqueId.js.map +1 -0
- package/lib/commonjs/restartApp.js +2 -0
- 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/module/CodePush.js +6 -2
- package/lib/module/CodePush.js.map +1 -1
- package/lib/module/allowRestart.js +2 -0
- package/lib/module/allowRestart.js.map +1 -1
- package/lib/module/checkForUpdates.js +23 -25
- package/lib/module/checkForUpdates.js.map +1 -1
- package/lib/module/clearUpdates.js +2 -1
- package/lib/module/clearUpdates.js.map +1 -1
- package/lib/module/disallowRestart.js +2 -0
- package/lib/module/disallowRestart.js.map +1 -1
- package/lib/module/enums/CheckFrequency.enum.js +2 -2
- package/lib/module/enums/InstallMode.enum.js +7 -3
- package/lib/module/enums/InstallMode.enum.js.map +1 -1
- package/lib/module/enums/SyncStatus.enum.js +7 -7
- package/lib/module/enums/UpdateState.enum.js +7 -6
- package/lib/module/enums/UpdateState.enum.js.map +1 -1
- package/lib/module/getClientUniqueId.js +12 -0
- package/lib/module/getClientUniqueId.js.map +1 -0
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internals/CodePushApiSdk.errors.js +20 -0
- package/lib/module/internals/CodePushApiSdk.errors.js.map +1 -0
- package/lib/module/internals/CodePushApiSdk.js +96 -0
- package/lib/module/internals/CodePushApiSdk.js.map +1 -0
- package/lib/module/{enums/DeploymentStatus.enum.js → internals/CodePushApiSdk.types.js} +2 -1
- package/lib/module/internals/CodePushApiSdk.types.js.map +1 -0
- package/lib/module/internals/RemotePackageImplementation.js +6 -5
- package/lib/module/internals/RemotePackageImplementation.js.map +1 -1
- package/lib/module/internals/getConfiguration.js +3 -0
- package/lib/module/internals/getConfiguration.js.map +1 -1
- package/lib/module/internals/utils/fetchRetry.js +55 -0
- package/lib/module/internals/utils/fetchRetry.js.map +1 -0
- package/lib/module/internals/utils/queryStringify.js +21 -0
- package/lib/module/internals/utils/queryStringify.js.map +1 -0
- package/lib/module/internals/utils/requestFetchAdapter.js +29 -0
- package/lib/module/internals/utils/requestFetchAdapter.js.map +1 -0
- package/lib/module/internals/version.js +1 -1
- package/lib/module/notifyAppReady.js +11 -9
- package/lib/module/notifyAppReady.js.map +1 -1
- package/lib/module/resetClientUniqueId.js +14 -0
- package/lib/module/resetClientUniqueId.js.map +1 -0
- package/lib/module/restartApp.js +2 -0
- 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/typescript/commonjs/src/CodePush.d.ts +10 -5
- package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/allowRestart.d.ts +2 -0
- 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 +2 -1
- package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/disallowRestart.d.ts +2 -0
- package/lib/typescript/commonjs/src/disallowRestart.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/enums/CheckFrequency.enum.d.ts +2 -2
- package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts +7 -3
- package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/enums/SyncStatus.enum.d.ts +7 -7
- package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts +7 -6
- package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/getClientUniqueId.d.ts +5 -0
- package/lib/typescript/commonjs/src/getClientUniqueId.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +3 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts +13 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.errors.d.ts +9 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts +101 -0
- package/lib/typescript/commonjs/src/internals/CodePushApiSdk.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +1 -0
- package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts +2 -2
- package/lib/typescript/commonjs/src/internals/RemotePackageImplementation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts +1 -0
- package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/types.d.ts +2 -2
- package/lib/typescript/commonjs/src/internals/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/internals/utils/fetchRetry.d.ts +9 -0
- package/lib/typescript/commonjs/src/internals/utils/fetchRetry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/utils/queryStringify.d.ts +4 -0
- package/lib/typescript/commonjs/src/internals/utils/queryStringify.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/utils/requestFetchAdapter.d.ts +3 -0
- package/lib/typescript/commonjs/src/internals/utils/requestFetchAdapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
- 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/resetClientUniqueId.d.ts +5 -0
- package/lib/typescript/commonjs/src/resetClientUniqueId.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/restartApp.d.ts +2 -0
- package/lib/typescript/commonjs/src/restartApp.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/sync.d.ts +3 -1
- package/lib/typescript/commonjs/src/sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types.d.ts +72 -29
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
- package/lib/typescript/module/src/CodePush.d.ts +10 -5
- package/lib/typescript/module/src/CodePush.d.ts.map +1 -1
- package/lib/typescript/module/src/allowRestart.d.ts +2 -0
- 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 +2 -1
- package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -1
- package/lib/typescript/module/src/disallowRestart.d.ts +2 -0
- package/lib/typescript/module/src/disallowRestart.d.ts.map +1 -1
- package/lib/typescript/module/src/enums/CheckFrequency.enum.d.ts +2 -2
- package/lib/typescript/module/src/enums/InstallMode.enum.d.ts +7 -3
- package/lib/typescript/module/src/enums/InstallMode.enum.d.ts.map +1 -1
- package/lib/typescript/module/src/enums/SyncStatus.enum.d.ts +7 -7
- package/lib/typescript/module/src/enums/UpdateState.enum.d.ts +7 -6
- package/lib/typescript/module/src/enums/UpdateState.enum.d.ts.map +1 -1
- package/lib/typescript/module/src/getClientUniqueId.d.ts +5 -0
- package/lib/typescript/module/src/getClientUniqueId.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +3 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts +13 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.errors.d.ts +9 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.errors.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts +101 -0
- package/lib/typescript/module/src/internals/CodePushApiSdk.types.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +1 -0
- package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts +2 -2
- package/lib/typescript/module/src/internals/RemotePackageImplementation.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/getConfiguration.d.ts +1 -0
- package/lib/typescript/module/src/internals/getConfiguration.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/types.d.ts +2 -2
- package/lib/typescript/module/src/internals/types.d.ts.map +1 -1
- package/lib/typescript/module/src/internals/utils/fetchRetry.d.ts +9 -0
- package/lib/typescript/module/src/internals/utils/fetchRetry.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/utils/queryStringify.d.ts +4 -0
- package/lib/typescript/module/src/internals/utils/queryStringify.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/utils/requestFetchAdapter.d.ts +3 -0
- package/lib/typescript/module/src/internals/utils/requestFetchAdapter.d.ts.map +1 -0
- package/lib/typescript/module/src/internals/version.d.ts +1 -1
- 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/resetClientUniqueId.d.ts +5 -0
- package/lib/typescript/module/src/resetClientUniqueId.d.ts.map +1 -0
- package/lib/typescript/module/src/restartApp.d.ts +2 -0
- package/lib/typescript/module/src/restartApp.d.ts.map +1 -1
- package/lib/typescript/module/src/sync.d.ts +3 -1
- package/lib/typescript/module/src/sync.d.ts.map +1 -1
- package/lib/typescript/module/src/types.d.ts +72 -29
- package/lib/typescript/module/src/types.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/CodePush.tsx +12 -5
- package/src/allowRestart.ts +2 -0
- package/src/checkForUpdates.ts +24 -23
- package/src/clearUpdates.ts +2 -1
- package/src/disallowRestart.ts +2 -0
- package/src/enums/CheckFrequency.enum.ts +2 -2
- package/src/enums/InstallMode.enum.ts +7 -3
- package/src/enums/SyncStatus.enum.ts +7 -7
- package/src/enums/UpdateState.enum.ts +7 -6
- package/src/getClientUniqueId.ts +9 -0
- package/src/index.ts +3 -1
- package/src/internals/CodePushApiSdk.errors.ts +22 -0
- package/src/internals/CodePushApiSdk.ts +133 -0
- package/src/internals/CodePushApiSdk.types.ts +115 -0
- package/src/internals/RNAppZungCodePushModuleSpec.ts +1 -0
- package/src/internals/RemotePackageImplementation.ts +8 -7
- package/src/internals/getConfiguration.ts +4 -0
- package/src/internals/types.ts +2 -2
- package/src/internals/utils/fetchRetry.ts +72 -0
- package/src/internals/utils/queryStringify.ts +22 -0
- package/src/internals/utils/requestFetchAdapter.ts +28 -0
- package/src/internals/version.ts +1 -1
- package/src/notifyAppReady.ts +12 -13
- package/src/resetClientUniqueId.ts +11 -0
- package/src/restartApp.ts +2 -0
- package/src/sync.ts +5 -3
- package/src/types.ts +72 -29
- package/typedoc.json +9 -0
- package/docs/advanced-usage.md +0 -56
- package/docs/api-android.md +0 -22
- package/docs/api-ios.md +0 -19
- package/docs/api-js.md +0 -557
- package/docs/code-signing.md +0 -62
- package/docs/migrating-to-v10.md +0 -31
- package/docs/setup-android.md +0 -81
- package/docs/setup-ios.md +0 -108
- package/docs/setup-windows.md +0 -55
- package/lib/commonjs/enums/DeploymentStatus.enum.js.map +0 -1
- package/lib/commonjs/internals/AcquisitionSdk.js +0 -9
- package/lib/commonjs/internals/AcquisitionSdk.js.map +0 -1
- package/lib/commonjs/internals/getPromisifiedSdk.js +0 -49
- package/lib/commonjs/internals/getPromisifiedSdk.js.map +0 -1
- package/lib/commonjs/internals/utils/request-fetch-adapter.js +0 -50
- package/lib/commonjs/internals/utils/request-fetch-adapter.js.map +0 -1
- package/lib/module/enums/DeploymentStatus.enum.js.map +0 -1
- package/lib/module/internals/AcquisitionSdk.js +0 -5
- package/lib/module/internals/AcquisitionSdk.js.map +0 -1
- package/lib/module/internals/getPromisifiedSdk.js +0 -45
- package/lib/module/internals/getPromisifiedSdk.js.map +0 -1
- package/lib/module/internals/utils/request-fetch-adapter.js +0 -46
- package/lib/module/internals/utils/request-fetch-adapter.js.map +0 -1
- package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts +0 -14
- package/lib/typescript/commonjs/src/enums/DeploymentStatus.enum.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts +0 -3
- package/lib/typescript/commonjs/src/internals/AcquisitionSdk.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts +0 -13
- package/lib/typescript/commonjs/src/internals/getPromisifiedSdk.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts +0 -3
- package/lib/typescript/commonjs/src/internals/utils/request-fetch-adapter.d.ts.map +0 -1
- package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts +0 -14
- package/lib/typescript/module/src/enums/DeploymentStatus.enum.d.ts.map +0 -1
- package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts +0 -3
- package/lib/typescript/module/src/internals/AcquisitionSdk.d.ts.map +0 -1
- package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts +0 -13
- package/lib/typescript/module/src/internals/getPromisifiedSdk.d.ts.map +0 -1
- package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts +0 -3
- package/lib/typescript/module/src/internals/utils/request-fetch-adapter.d.ts.map +0 -1
- package/src/enums/DeploymentStatus.enum.ts +0 -14
- package/src/internals/AcquisitionSdk.ts +0 -3
- package/src/internals/getPromisifiedSdk.ts +0 -72
- package/src/internals/utils/request-fetch-adapter.ts +0 -58
package/src/types.ts
CHANGED
|
@@ -1,56 +1,83 @@
|
|
|
1
|
-
import type { NativeUpdateNotification } from 'code-push/script/acquisition-sdk';
|
|
2
|
-
import type { DeploymentStatus } from './enums/DeploymentStatus.enum';
|
|
3
1
|
import type { InstallMode } from './enums/InstallMode.enum';
|
|
4
2
|
import type { SyncStatus } from './enums/SyncStatus.enum';
|
|
3
|
+
import { DeploymentStatus } from './internals/CodePushApiSdk.types';
|
|
5
4
|
|
|
6
5
|
export interface UpdateDialog {
|
|
7
6
|
/**
|
|
8
7
|
* Indicates whether you would like to append the description of an available release to the
|
|
9
|
-
* notification message which is displayed to the end user.
|
|
8
|
+
* notification message which is displayed to the end user.
|
|
9
|
+
*
|
|
10
|
+
* Defaults to false.
|
|
10
11
|
*/
|
|
11
12
|
appendReleaseDescription?: boolean;
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Indicates the string you would like to prefix the release description with, if any, when
|
|
15
|
-
* displaying the update notification to the end user.
|
|
16
|
+
* displaying the update notification to the end user.
|
|
17
|
+
*
|
|
18
|
+
* Defaults to " Description: "
|
|
16
19
|
*/
|
|
17
20
|
descriptionPrefix?: string;
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
|
-
* The text to use for the button the end user must press in order to install a mandatory update.
|
|
23
|
+
* The text to use for the button the end user must press in order to install a mandatory update.
|
|
24
|
+
*
|
|
25
|
+
* Defaults to "Continue".
|
|
21
26
|
*/
|
|
22
27
|
mandatoryContinueButtonLabel?: string;
|
|
23
28
|
|
|
24
29
|
/**
|
|
25
30
|
* The text used as the body of an update notification, when the update is specified as mandatory.
|
|
31
|
+
*
|
|
26
32
|
* Defaults to "An update is available that must be installed.".
|
|
27
33
|
*/
|
|
28
34
|
mandatoryUpdateMessage?: string;
|
|
29
35
|
|
|
30
36
|
/**
|
|
31
|
-
* The text to use for the button the end user can press in order to ignore an optional update that is available.
|
|
37
|
+
* The text to use for the button the end user can press in order to ignore an optional update that is available.
|
|
38
|
+
*
|
|
39
|
+
* Defaults to "Ignore".
|
|
32
40
|
*/
|
|
33
41
|
optionalIgnoreButtonLabel?: string;
|
|
34
42
|
|
|
35
43
|
/**
|
|
36
|
-
* The text to use for the button the end user can press in order to install an optional update.
|
|
44
|
+
* The text to use for the button the end user can press in order to install an optional update.
|
|
45
|
+
*
|
|
46
|
+
* Defaults to "Install".
|
|
37
47
|
*/
|
|
38
48
|
optionalInstallButtonLabel?: string;
|
|
39
49
|
|
|
40
50
|
/**
|
|
41
|
-
* The text used as the body of an update notification, when the update is optional.
|
|
51
|
+
* The text used as the body of an update notification, when the update is optional.
|
|
52
|
+
*
|
|
53
|
+
* Defaults to "An update is available. Would you like to install it?".
|
|
42
54
|
*/
|
|
43
55
|
optionalUpdateMessage?: string;
|
|
44
56
|
|
|
45
57
|
/**
|
|
46
|
-
* The text used as the header of an update notification that is displayed to the end user.
|
|
58
|
+
* The text used as the header of an update notification that is displayed to the end user.
|
|
59
|
+
*
|
|
60
|
+
* Defaults to "Update available".
|
|
47
61
|
*/
|
|
48
62
|
title?: string;
|
|
49
63
|
}
|
|
50
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Called periodically when an available update is being downloaded from the CodePush server.
|
|
67
|
+
*/
|
|
51
68
|
export type DownloadProgressCallback = (progress: DownloadProgress) => void;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Called when the sync process moves from one stage to another in the overall update process.
|
|
72
|
+
*
|
|
73
|
+
* The method is called with a status code which represents the current state, and can be any of the `SyncStatus` values.
|
|
74
|
+
*/
|
|
52
75
|
export type SyncStatusChangedCallback = (status: SyncStatus) => void;
|
|
53
|
-
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Called when there are any binary update available.
|
|
79
|
+
*/
|
|
80
|
+
export type HandleBinaryVersionMismatchCallback = (update: { appVersion: string }) => void;
|
|
54
81
|
|
|
55
82
|
export interface DownloadProgress {
|
|
56
83
|
/**
|
|
@@ -64,6 +91,9 @@ export interface DownloadProgress {
|
|
|
64
91
|
receivedBytes: number;
|
|
65
92
|
}
|
|
66
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Represents a downloaded update that is either already running, or has been installed and is pending an app restart.
|
|
96
|
+
*/
|
|
67
97
|
export interface LocalPackage extends Package {
|
|
68
98
|
/**
|
|
69
99
|
* Installs the update by saving it to the location on disk where the runtime expects to find the latest version of the app.
|
|
@@ -82,7 +112,7 @@ export interface LocalPackage extends Package {
|
|
|
82
112
|
export interface Package {
|
|
83
113
|
/**
|
|
84
114
|
* The app binary version that this update is dependent on. This is the value that was
|
|
85
|
-
* specified via the
|
|
115
|
+
* specified via the --target-binary-version parameter when calling the CLI's release command.
|
|
86
116
|
*/
|
|
87
117
|
appVersion: string;
|
|
88
118
|
|
|
@@ -98,11 +128,15 @@ export interface Package {
|
|
|
98
128
|
|
|
99
129
|
/**
|
|
100
130
|
* Indicates whether this update has been previously installed but was rolled back.
|
|
131
|
+
*
|
|
132
|
+
* The `sync` method will automatically ignore updates which have previously failed, so you only need to worry about this property if using `checkForUpdate`.
|
|
101
133
|
*/
|
|
102
134
|
failedInstall: boolean;
|
|
103
135
|
|
|
104
136
|
/**
|
|
105
137
|
* Indicates whether this is the first time the update has been run after being installed.
|
|
138
|
+
*
|
|
139
|
+
* This is useful for determining whether you would like to show a "What's New?" UI to the end user after installing an update.
|
|
106
140
|
*/
|
|
107
141
|
isFirstRun: boolean;
|
|
108
142
|
|
|
@@ -133,6 +167,9 @@ export interface Package {
|
|
|
133
167
|
packageSize: number;
|
|
134
168
|
}
|
|
135
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Represents an available update on the CodePush server that hasn't been downloaded yet.
|
|
172
|
+
*/
|
|
136
173
|
export interface RemotePackage extends Package {
|
|
137
174
|
/**
|
|
138
175
|
* Downloads the available update from the CodePush service.
|
|
@@ -143,27 +180,31 @@ export interface RemotePackage extends Package {
|
|
|
143
180
|
|
|
144
181
|
/**
|
|
145
182
|
* The URL at which the package is available for download.
|
|
183
|
+
*
|
|
184
|
+
* This property is only needed for advanced usage, since the `download` method will automatically handle the acquisition of updates for you.
|
|
146
185
|
*/
|
|
147
186
|
downloadUrl: string;
|
|
148
187
|
}
|
|
149
188
|
|
|
150
189
|
export interface SyncOptions {
|
|
151
190
|
/**
|
|
152
|
-
* Specifies the release channel you want to query for an update against.
|
|
153
|
-
*
|
|
154
|
-
* dynamically use a different release channel for a specific call to sync.
|
|
191
|
+
* Specifies the release channel you want to query for an update against.
|
|
192
|
+
*
|
|
193
|
+
* By default, this value is derived from the Info.plist file (iOS) and strings resources (Android), but this option allows you to override it from the JS-side if you need to dynamically use a different release channel for a specific call to sync.
|
|
155
194
|
*/
|
|
156
195
|
releaseChannelPublicId?: string;
|
|
157
196
|
|
|
158
197
|
/**
|
|
159
|
-
* Specifies when you would like to install
|
|
160
|
-
*
|
|
198
|
+
* Specifies when you would like to install regular updates (i.e. those that aren't marked as mandatory).
|
|
199
|
+
*
|
|
200
|
+
* Defaults to InstallMode.ON_NEXT_RESTART.
|
|
161
201
|
*/
|
|
162
202
|
installMode?: InstallMode;
|
|
163
203
|
|
|
164
204
|
/**
|
|
165
205
|
* Specifies when you would like to install updates which are marked as mandatory.
|
|
166
|
-
*
|
|
206
|
+
*
|
|
207
|
+
* Defaults to InstallMode.IMMEDIATE.
|
|
167
208
|
*/
|
|
168
209
|
mandatoryInstallMode?: InstallMode;
|
|
169
210
|
|
|
@@ -176,19 +217,18 @@ export interface SyncOptions {
|
|
|
176
217
|
minimumBackgroundDuration?: number;
|
|
177
218
|
|
|
178
219
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* overriding one or more of the default strings.
|
|
220
|
+
* Used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use.
|
|
221
|
+
*
|
|
222
|
+
* Defaults to null, which has the effect of disabling the dialog completely.
|
|
223
|
+
* Setting this to true will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings.
|
|
183
224
|
*/
|
|
184
225
|
updateDialog?: UpdateDialog | true;
|
|
185
226
|
|
|
186
227
|
/**
|
|
187
|
-
* The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
* the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding
|
|
191
|
-
* one or more of the default values.
|
|
228
|
+
* The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions specified in the options).
|
|
229
|
+
*
|
|
230
|
+
* This defaults to null, which has the effect of disabling the retry mechanism.
|
|
231
|
+
* Setting this to true will enable the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding one or more of the default values.
|
|
192
232
|
*/
|
|
193
233
|
rollbackRetryOptions?: RollbackRetryOptions | true;
|
|
194
234
|
|
|
@@ -197,14 +237,17 @@ export interface SyncOptions {
|
|
|
197
237
|
|
|
198
238
|
export interface RollbackRetryOptions {
|
|
199
239
|
/**
|
|
200
|
-
* Specifies the minimum time in hours that the app will wait after the latest rollback
|
|
201
|
-
*
|
|
240
|
+
* Specifies the minimum time in hours that the app will wait after the latest rollback before attempting to reinstall same rolled-back package.
|
|
241
|
+
*
|
|
242
|
+
* Defaults to `24`.
|
|
202
243
|
*/
|
|
203
244
|
delayInHours?: number;
|
|
204
245
|
|
|
205
246
|
/**
|
|
206
247
|
* Specifies the maximum number of retry attempts that the app can make before it stops trying.
|
|
207
|
-
* Cannot be less than `1`.
|
|
248
|
+
* Cannot be less than `1`.
|
|
249
|
+
*
|
|
250
|
+
* Defaults to `1`.
|
|
208
251
|
*/
|
|
209
252
|
maxRetryAttempts?: number;
|
|
210
253
|
}
|
package/typedoc.json
ADDED
package/docs/advanced-usage.md
DELETED
|
@@ -1,56 +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.
|
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`.
|