$ npm install react-native-app-relauncher --save
$ react-native link react-native-app-relauncher
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import io.stepan.RNAppRelauncherPackage;
to the imports at the top of the file - Add
new RNAppRelauncherPackage(MainActivity.activity)
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-app-relauncher' project(':react-native-app-relauncher').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-app-relauncher/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-app-relauncher')
import RNAppRelauncher from 'react-native-app-relauncher';
RNAppRelauncher.relaunch();