Closed cnlkkrb closed 9 months ago
const AppRoot = () => { const [progress, setProgress] = useState(false); const checkForUpdate = async () => { try { const update = await CodePush.checkForUpdate(); if (update) { setProgress(true); CodePush.sync( { deploymentKey: 'M8_hdiay-n8fu3sIJ-o8VW7a7P9rqYHQf3YlG', updateDialog: false, installMode: CodePush.InstallMode.IMMEDIATE, }, syncStatus => { switch (syncStatus) { case CodePush.SyncStatus.CHECKING_FOR_UPDATE: break; case CodePush.SyncStatus.DOWNLOADING_PACKAGE: break; case CodePush.SyncStatus.INSTALLING_UPDATE: break; case CodePush.SyncStatus.UPDATE_INSTALLED: break; } }, ); } } catch (error) { console.error('CodePush update error:', error); } finally { setProgress(false) }
};
useEffect(() => { checkForUpdate(); }, []); {!!progress ? ( <Modal visible={true} transparent> <View style={{ backgroundColor: 'rgba(0,0,0,0.8)', flex: 1, justifyContent: 'center', alignItems: 'center', }}> <Text style={styles.text}>Güncellemeler Yükleniyor...</Text> <View style={{alignItems: 'center'}}> <ActivityIndicator size={'large'} style={{marginVertical: 8}} color={'#004880'} /> </View> </View> </Modal> ) : null}
Hi @cnlkkrb and thanks for reaching us out. You can find instructions on how to do this in the documentation, so I'll close this issue. But if you have any more questions, feel free to reopen it.
};