rn-android-overlay-permission
This module is to request screen overlay permission from user in react-native based android application
Getting started
$ npm install rn-android-overlay-permission --save
Mostly automatic installation
$ react-native link rn-android-overlay-permission
Add these permissions in AndroidManifest.xml
<uses-permission android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION" /><uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.overlaypermission.OverlayPermissionPackage;
to the imports at the top of the file
-
Append the following lines to
android/settings.gradle
:include ':rn-android-overlay-permission' project(':rn-android-overlay-permission').projectDir = new File(rootProject.projectDir, '../node_modules/rn-android-overlay-permission/android')
-
Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':rn-android-overlay-permission')
Usage
//requestOverlayPermission Navigates to permission settingsOverlayPermissionModule;
; if PlatformOS === "android" OverlayPermissionModule;