forked from microsoft/react-native-code-push
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
on update it doesnot reflect the change code in the immediate boot, if i rebooot it manually it works, this issue is seen only in android
Environment
@code-push-next/react-native-code-push version: 1.2.0
react-native version: 0.81.1
code
useEffect(() => {
codePush.notifyAppReady();
}, []);
useEffect(() => {
try {
codePush.sync(
{
installMode: codePush.InstallMode.IMMEDIATE,
deploymentKey: codePushKey
},
codePushStatusDidChange,
codePushDownloadDidProgress
);
} catch (error) {
console.warn('error', error);
}
}, []);
const codePushStatusDidChange = (syncStatus: codePush.SyncStatus) => {
switch (syncStatus) {
case codePush.SyncStatus.CHECKING_FOR_UPDATE:
setStatus('Checking for Updates');
break;
case codePush.SyncStatus.DOWNLOADING_PACKAGE:
setStatus('Downloading Updates');
break;
case codePush.SyncStatus.INSTALLING_UPDATE:
setStatus('Installing Updates');
break;
case codePush.SyncStatus.UP_TO_DATE:
setStatus('Up to Date');
setVisible(false);
setTimeout(() => {
dispatch(commonAction.showCodePush(true))
}, 500);
break;
case codePush.SyncStatus.UPDATE_INSTALLED:
setStatus('Update Installed');
codePush.restartApp();
break;
case codePush.SyncStatus.UNKNOWN_ERROR:
default:
setStatus('');
setVisible(false);
dispatch(commonAction.showCodePush(true))
}
};
const codePushDownloadDidProgress = (progress) => {
setDownloadProgress(progress)
};
Metadata
Metadata
Assignees
Labels
No labels