$ npm install react-native-install-silent --save
$ react-native link react-native-install-silent
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import cn.nhsoft.RNInstallSilentPackage;
to the imports at the top of the file - Add
new RNInstallSilentPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-install-silent' project(':react-native-install-silent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-install-silent/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-install-silent')
import RNInstallSilent from 'react-native-install-silent';
// TODO: What to do with the module?
RNInstallSilent;