1.0.1 • Published 4 years ago
react-native-restart-app-android v1.0.1
react-native-restart-app-android
Getting started
$ npm install react-native-restart-app-android --save
Mostly automatic installation
$ react-native link react-native-restart-app-android
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNRestartAppAndroidPackage;
to the imports at the top of the file - Add
new RNRestartAppAndroidPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-restart-app-android' project(':react-native-restart-app-android').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-restart-app-android/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-restart-app-android')
Usage
import RNRestartAppAndroid from 'react-native-restart-app-android';
// TODO: What to do with the module?
RNRestartAppAndroid;