Update is installed but status is in pending on App Center. Since sync is alreday called , it won't rollback automatically and also not updating to newer version. The app crashes on startup everytime.
So how to rollback or update to new code push bundle version in this case ?
Here is the sample code:
componentDidMount() {
codePush.sync(codePushOptions,(status) => {
switch (status) {
case codePush.SyncStatus.CHECKING_FOR_UPDATE:
//console.log("Checking for updates.");
break;
case codePush.SyncStatus.DOWNLOADING_PACKAGE:
//console.log("Downloading package.");
break;
case codePush.SyncStatus.INSTALLING_UPDATE:
//console.log("Installing update.");
break;
case codePush.SyncStatus.UP_TO_DATE:
break;
case codePush.SyncStatus.UPDATE_INSTALLED:
break;
}
})
throw new Error();
}
Note : I have thrown error to check working of auto rollback.