Sushant-Sardeshpande / react-native-exit-app

Exit,close,kill,shutdown app completely for React Native on iOS and Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-exit-app

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

Setup

npm install react-native-exit-app

Or add the latest version as dependeny to your package.json.

{
  "name": "YourProject",
  ...
  },
  "dependencies": {
    ...
    "react-native-exit-app": "0.1.0",
    ...
  }

####iOS

  • Add RNExitApp.xcoderproj into your project in the Libraries folder.
  • Add the .a file on the General tab of your target under Linked Frameworks And Libraries
  • Add the .a file on the Build Phases tab of your target under Link Binary With Libraries

####Android

  • In the settings.gradle
      include ':react-native-exit-app', ':app'
      project(':react-native-exit-app').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-exit-app/android')
    
  • In the build.gradle
      compile project(':react-native-exit-app')
    
  • In MainApplication.java
      import com.github.wumke.RNExitApp.RNExitAppPackage;
      ...
      @Override
      protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
          ...
          new RNExitAppPackage(),
          ...
        );
      }
      ...
    

Usage

import RNExitApp from 'react-native-exit-app';
...
RNExitApp.exitApp();
...

Versioning

This project uses semantic versioning: MAJOR.MINOR.PATCH. This means that releases within the same MAJOR version are always backwards compatible. For more info see semver.org.

About

Exit,close,kill,shutdown app completely for React Native on iOS and Android.

License:GNU General Public License v3.0


Languages

Language:Java 85.0%Language:Objective-C 8.4%Language:JavaScript 6.6%