Add alert before closing

This commit is contained in:
Sofiya Tepikin
2022-06-23 21:46:41 +02:00
parent f223616ee1
commit 7a6643cc1a
+7 -1
View File
@@ -1,5 +1,11 @@
// Current version of react-native-restart doesn't work with our ios setup // Current version of react-native-restart doesn't work with our ios setup
// therefore we have a fork and use different libraries on the platforms // therefore we have a fork and use different libraries on the platforms
import RNExitApp from 'react-native-exit-app-v2' import RNExitApp from 'react-native-exit-app-v2'
import { Alert } from 'react-native'
export const restartApp = RNExitApp.exitApp export const restartApp = () => {
Alert.alert('Closing app', 'App is shutting down. Please restart.')
setTimeout(() => {
RNExitApp.exitApp()
}, 3000)
}