Add alert before closing
This commit is contained in:
1 parent
f223616ee1
commit
7a6643cc1a
1 file changed
+7
-1
@@ -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)
|
||||||
|
}
|
||||||
Reference in new issue
Block a user