$ npm install react-native-display-cutout --save
or
$ yarn add react-native-display-cutout
$ react-native link react-native-display-cutout
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.rajivshah.displaycutout.RNDisplayCutoutPackage;
to the imports at the top of the file - Add
new RNDisplayCutoutPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-display-cutout' project(':react-native-display-cutout').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-display-cutout/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-display-cutout')
See the full documentation here
import RNDisplayCutout from 'react-native-display-cutout';
// TODO: What to do with the module?