Skip to content

Commit 4096960

Browse files
Added README
1 parent 5ab1166 commit 4096960

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# @logicwind/react-native-exit-app
2+
3+
`@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.
4+
5+
## Installation
6+
7+
Using npm:
8+
9+
```sh md title="Terminal"
10+
npm install @logicwind/react-native-exit-app
11+
```
12+
13+
or using yarn:
14+
15+
```sh md title="Terminal"
16+
yarn add @logicwind/react-native-exit-app
17+
```
18+
19+
### iOS Setup
20+
21+
After installation, make sure to install CocoaPods:
22+
23+
```sh md title="Terminal"
24+
cd ios && pod install
25+
```
26+
27+
### Android Setup
28+
29+
No additional setup is required.
30+
31+
## Usage
32+
33+
Import and use the `exitApp` function to get the status bar height.
34+
35+
```tsx md title="App.tsx"
36+
import { exitApp } from 'react-native-exit-app';
37+
38+
<Button title="Exit App" onPress={() => exitApp()} />;
39+
```
40+
41+
## How It Works
42+
43+
`@logicwind/react-native-exit-app` uses native code to exit the app based on the platform:
44+
45+
- **iOS:** The module uses exit(0) to force the app to close.
46+
- **Android:** The module calls System.exit(0) or finishes the activity to terminate the app.
47+
48+
## react-native-exit-app is crafted mindfully at [Logicwind](https://www.logicwind.com?utm_source=github&utm_medium=github.com-logicwind&utm_campaign=react-native-exit-app)
49+
50+
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](mailto:[email protected]) or through or [contact form](https://www.logicwind.com/book-call?utm_source=github&utm_medium=github.com-logicwind&utm_campaign=react-native-exit-app)!
51+
52+
We will always answer you with pleasure 😁
53+
54+
## License
55+
56+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

0 commit comments

Comments
 (0)