@logicwind/react-native-exit-app v0.1.0
@logicwind/react-native-exit-app
@logicwind/react-native-exit-app is a simple React Native library that allows you to programmatically exit or close your app. It's useful for scenarios where you want to force the app to close, such as after a logout, session timeout, or a critical error. The library supports both Android and iOS as well as TvOS.
Installation
Using npm:
npm install @logicwind/react-native-exit-appor using yarn:
yarn add @logicwind/react-native-exit-appiOS Setup
After installation, make sure to install CocoaPods:
cd ios && pod installAndroid Setup
No additional setup is required.
Usage
Import and use the exitApp function.
import { exitApp } from '@logicwind/react-native-exit-app';
<Button title="Exit App" onPress={() => exitApp()} />;How It Works
@logicwind/react-native-exit-app uses native code to exit the app based on the platform:
- iOS: The module uses exit(0) to force the app to close.
- Android: The module calls System.exit(0) or finishes the activity to terminate the app.
react-native-exit-app is crafted mindfully at Logicwind
We are a 130+ people company developing and designing multiplatform applications using the Lean & Agile methodology. To get more information on the solutions that would suit your needs, feel free to get in touch by email or through or contact form!
We will always answer you with pleasure 😁
License
This project is licensed under the MIT License - see the LICENSE file for details
6 months ago