rn-autostart
v1.0.3
Published
## Getting started
Downloads
4
Readme
rn-autostart
Getting started
$ npm install rn-autostart --save
Mostly automatic installation
$ react-native link rn-autostart
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.killserver.autostart.AutostartPackage;
to the imports at the top of the file - Add
new AutostartPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':rn-autostart' project(':rn-autostart').projectDir = new File(rootProject.projectDir, '../node_modules/rn-autostart/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':rn-autostart')
Usage
import Autostart from 'rn-autostart';
// check the autostart preferences menu for device. return Promise
Autostart.isSupported();
// open the autostart preferences menu for device
Autostart.open();