Skip to content

logicwind/react-native-exit-app

Repository files navigation

@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-app

or using yarn:

yarn add @logicwind/react-native-exit-app

Expo Setup

If you're working with this Expo project, make sure to run:

npx expo prebuild

iOS Setup

After installation, make sure to install CocoaPods:

cd ios && pod install

Android 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

About

Exit / Close / Kill / shutdown your react native app. Does not invoke a crash notification.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •