You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
installMode: InstallMode.ON_NEXT_RESTART, // this is the default, and at this moment the only option
123
-
serverUrl: "https://your-backend.server"// by default this is our shared cloud hosted backend server
122
+
installMode: InstallMode.ON_NEXT_RESTART, // this is the default install mode; the app updates upon the next cold boot (unless the --mandatory flag was specified while pushing the update)
123
+
mandatoryInstallMode: InstallMode.IMMEDIATE, // the default is InstallMode.ON_NEXT_RESUME which doesn't bother the user as long as the app is in the foreground. InstallMode.IMMEDIATE shows an installation prompt. Don't use that for iOS AppStore distributions because Apple doesn't want you to.
124
+
serverUrl: "https://your-backend.server", // by default this is our shared cloud hosted backend server, so you probably want to leave this out
125
+
updateDialog: { // only used for InstallMode.IMMEDIATE
126
+
updateTitle: "Please restart the app", // an optional title shown in the update dialog
127
+
optionalUpdateMessage: "Optional update msg", // a message shown for non-"--mandatory" releases
128
+
mandatoryUpdateMessage: "Mandatory update msg", // a message shown for "--mandatory" releases
129
+
optionalIgnoreButtonLabel: "Later", // if a user wants to continue their session, the update will be installed on next resume
130
+
mandatoryContinueButtonLabel: isIOS?"Exit now":"Restart now", // On Android we can kill and restart the app, but on iOS that's not possible so the user has to manually restart it. That's why we provide a different label in this example.
131
+
appendReleaseDescription: true// appends the description you (optionally) provided when releasing a new version to CodePush
132
+
}
124
133
}, (syncStatus:SyncStatus):void=> {
125
134
console.log("CodePush syncStatus: "+syncStatus);
126
135
if (syncStatus===SyncStatus.UP_TO_DATE) {
@@ -131,8 +140,7 @@ CodePush.sync({
131
140
});
132
141
```
133
142
134
-
It's recommended to check for updates more than once in a cold boot cycle, so it may be easiest to
135
-
tie this check to the `resume` event:
143
+
It's recommended to check for updates more than once in a cold boot cycle, so it may be easiest to tie this check to the `resume` event:
@@ -151,18 +159,18 @@ The easiest way to do this is to use the `release-nativescript` command in our C
151
159
152
160
|param|alias|default|description
153
161
|---|---|---|---
154
-
|deploymentName|d|Staging|Deploy to either "Staging" or "Production".
162
+
|deploymentName|d|"Staging"|Deploy to either "Staging" or "Production".
155
163
|description|des||Description of the changes made to the app with this release.
156
164
|targetBinaryVersion|t||Semver expression that specifies the binary app version(s) this release is targeting (e.g. 1.1.0, ~1.2.3).
157
-
|rollout|r|100%|Percentage of users this release should be available to. The `%` sign is optional.
165
+
|mandatory|m|not set, so "optional"|This specifies whether the update should be considered mandatory or not (e.g. it includes a critical security fix). This attribute is simply round tripped to the client, who can then decide if and how they would like to enforce it. This is flag, so its absence indicates an optional release.
158
166
159
167
### iOS
160
168
161
169
```shell
162
170
nativescript-code-push release-nativescript <codepush-ios-appname> ios # deploy to Staging
163
171
nativescript-code-push release-nativescript <codepush-ios-appname> ios --d Production # deploy to Production (default: Staging)
164
172
nativescript-code-push release-nativescript <codepush-ios-appname> ios --targetBinaryVersion ~1.0.0 # release to users running any 1.x version (default: the exact version in Info.plist)
165
-
nativescript-code-push release-nativescript <codepush-ios-appname> ios --rollout 25 --description "My awesome iOS version"#percentage of users this release should be immediately available to (default: 100)
173
+
nativescript-code-push release-nativescript <codepush-ios-appname> ios --mandatory --description "My mandatory iOS version"#mandatory release for iOS
166
174
```
167
175
168
176
### Android
@@ -189,8 +197,5 @@ nativescript-code-push deployment history <codepush-ios-appname> Staging
189
197
You may want to play with CodePush before using it in production (smart move!).
190
198
Perform these steps once you've pushed an update and added the `sync` command to your app:
191
199
192
-
-`$ tns run <platform>`. On an iOS device add the `--release` flag so LiveSync doesn't interfere.
200
+
-`$ tns run <platform>`. On an iOS *device* add the `--release` flag so LiveSync doesn't interfere.
193
201
- kill and restart the app after the update is installed
194
-
195
-
## Future enhancements
196
-
Support on-resume reloads. I haven't investigated this possibility yet. If it can be pulled off we'll add an option to the `sync` command.
0 commit comments