File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,13 @@ CodePush.sync({
114
114
If you have an iOS and Android app, and want some feedback during the sync, you can use this more elaborate version instead:
115
115
116
116
``` typescript
117
- import { CodePush , SyncStatus } from " nativescript-code-push" ;
118
- import { isIOS } from " platform" ;
117
+ import { CodePush , InstallMode , SyncStatus } from " nativescript-code-push" ;
118
+ import { isIOS } from " tns-core-modules/ platform" ;
119
119
120
120
CodePush .sync ({
121
- deploymentKey: isIOS ? " your-ios-deployment-key" : " your-android-deployment-key"
121
+ deploymentKey: isIOS ? " your-ios-deployment-key" : " your-android-deployment-key" ,
122
+ 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
124
}, (syncStatus : SyncStatus ): void => {
123
125
console .log (" CodePush syncStatus: " + syncStatus );
124
126
if (syncStatus === SyncStatus .UP_TO_DATE ) {
Original file line number Diff line number Diff line change @@ -35,8 +35,7 @@ export class HelloWorldModel extends Observable {
35
35
CodePush . sync ( {
36
36
deploymentKey : isIOS ? HelloWorldModel . CODEPUSH_IOS_STAGING_KEY : HelloWorldModel . CODEPUSH_ANDROID_STAGING_KEY ,
37
37
installMode : InstallMode . ON_NEXT_RESTART , // has not effect currently, always using ON_NEXT_RESTART
38
- mandatoryInstallMode : InstallMode . IMMEDIATE , // has not effect currently, always using ON_NEXT_RESTART
39
- // serverUrl: "https://www.nu.nl"
38
+ mandatoryInstallMode : InstallMode . IMMEDIATE // has not effect currently, always using ON_NEXT_RESTART
40
39
} , ( syncStatus : SyncStatus ) : void => {
41
40
console . log ( "syncStatus: " + syncStatus ) ;
42
41
if ( syncStatus === SyncStatus . UP_TO_DATE ) {
Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ export class CodePush {
99
99
}
100
100
CodePush . syncInProgress = true ;
101
101
102
+ // by default, use our Cloud server
103
+ options . serverUrl = options . serverUrl || "https://nativescript-codepush-server.herokuapp.com/" ;
104
+
102
105
CodePush . cleanPackagesIfNeeded ( ) ;
103
106
104
107
CodePush . notifyApplicationReady ( options . deploymentKey , options . serverUrl ) ;
You can’t perform that action at this time.
0 commit comments