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