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({
114114If you have an iOS and Android app, and want some feedback during the sync, you can use this more elaborate version instead:
115115
116116``` 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" ;
119119
120120CodePush .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
122124 }, (syncStatus : SyncStatus ): void => {
123125 console .log (" CodePush syncStatus: " + syncStatus );
124126 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 {
3535 CodePush . sync ( {
3636 deploymentKey : isIOS ? HelloWorldModel . CODEPUSH_IOS_STAGING_KEY : HelloWorldModel . CODEPUSH_ANDROID_STAGING_KEY ,
3737 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
4039 } , ( syncStatus : SyncStatus ) : void => {
4140 console . log ( "syncStatus: " + syncStatus ) ;
4241 if ( syncStatus === SyncStatus . UP_TO_DATE ) {
Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ export class CodePush {
9999 }
100100 CodePush . syncInProgress = true ;
101101
102+ // by default, use our Cloud server
103+ options . serverUrl = options . serverUrl || "https://nativescript-codepush-server.herokuapp.com/" ;
104+
102105 CodePush . cleanPackagesIfNeeded ( ) ;
103106
104107 CodePush . notifyApplicationReady ( options . deploymentKey , options . serverUrl ) ;
You can’t perform that action at this time.
0 commit comments