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
{{ message }}
This repository was archived by the owner on May 20, 2025. It is now read-only.
IMMEDIATE: NativeCodePush.codePushInstallModeImmediate,// Restart the app immediately
383
-
ON_NEXT_RESTART: NativeCodePush.codePushInstallModeOnNextRestart,// Don't artificially restart the app. Allow the update to be "picked up" on the next app restart
384
-
ON_NEXT_RESUME: NativeCodePush.codePushInstallModeOnNextResume// Restart the app the next time it is resumed from the background
385
-
},
386
-
SyncStatus: {
387
-
CHECKING_FOR_UPDATE: 0,
388
-
AWAITING_USER_ACTION: 1,
389
-
DOWNLOADING_PACKAGE: 2,
390
-
INSTALLING_UPDATE: 3,
391
-
UP_TO_DATE: 4,// The running app is up-to-date
392
-
UPDATE_IGNORED: 5,// The app had an optional update and the end-user chose to ignore it
393
-
UPDATE_INSTALLED: 6,// The app had an optional/mandatory update that was successfully downloaded and is about to be installed.
394
-
SYNC_IN_PROGRESS: 7,// There is an ongoing "sync" operation in progress.
395
-
UNKNOWN_ERROR: -1
396
-
},
397
-
DEFAULT_UPDATE_DIALOG: {
398
-
appendReleaseDescription: false,
399
-
descriptionPrefix: " Description: ",
400
-
mandatoryContinueButtonLabel: "Continue",
401
-
mandatoryUpdateMessage: "An update is available that must be installed.",
402
-
optionalIgnoreButtonLabel: "Ignore",
403
-
optionalInstallButtonLabel: "Install",
404
-
optionalUpdateMessage: "An update is available. Would you like to install it?",
405
-
title: "Update available"
406
-
}
407
-
};
372
+
letCodePush;
373
+
374
+
// If the "NativeCodePush" variable isn't defined, then
375
+
// the app didn't properly install the native module,
376
+
// and therefore, it doesn't make sense initializing
377
+
// the the JS interface when it wouldn't work anyways.
378
+
if(NativeCodePush){
379
+
CodePush={
380
+
AcquisitionSdk: Sdk,
381
+
checkForUpdate,
382
+
getConfiguration,
383
+
getCurrentPackage,
384
+
log,
385
+
notifyApplicationReady,
386
+
restartApp,
387
+
setUpTestDependencies,
388
+
sync,
389
+
InstallMode: {
390
+
IMMEDIATE: NativeCodePush.codePushInstallModeImmediate,// Restart the app immediately
391
+
ON_NEXT_RESTART: NativeCodePush.codePushInstallModeOnNextRestart,// Don't artificially restart the app. Allow the update to be "picked up" on the next app restart
392
+
ON_NEXT_RESUME: NativeCodePush.codePushInstallModeOnNextResume// Restart the app the next time it is resumed from the background
393
+
},
394
+
SyncStatus: {
395
+
CHECKING_FOR_UPDATE: 0,
396
+
AWAITING_USER_ACTION: 1,
397
+
DOWNLOADING_PACKAGE: 2,
398
+
INSTALLING_UPDATE: 3,
399
+
UP_TO_DATE: 4,// The running app is up-to-date
400
+
UPDATE_IGNORED: 5,// The app had an optional update and the end-user chose to ignore it
401
+
UPDATE_INSTALLED: 6,// The app had an optional/mandatory update that was successfully downloaded and is about to be installed.
402
+
SYNC_IN_PROGRESS: 7,// There is an ongoing "sync" operation in progress.
403
+
UNKNOWN_ERROR: -1
404
+
},
405
+
DEFAULT_UPDATE_DIALOG: {
406
+
appendReleaseDescription: false,
407
+
descriptionPrefix: " Description: ",
408
+
mandatoryContinueButtonLabel: "Continue",
409
+
mandatoryUpdateMessage: "An update is available that must be installed.",
410
+
optionalIgnoreButtonLabel: "Ignore",
411
+
optionalInstallButtonLabel: "Install",
412
+
optionalUpdateMessage: "An update is available. Would you like to install it?",
413
+
title: "Update available"
414
+
}
415
+
}
416
+
}else{
417
+
log("The CodePush module doesn't appear to be properly installed. Please double-check that everything is setup correctly.");
0 commit comments