@husam287/react-native-draw-overlay

1.0.0 • Public • Published

react-native-draw-overlay

Ask for draw over other apps permission.

Getting started

$ npm install react-native-draw-overlay --save

Mostly automatic installation

$ react-native link react-native-draw-overlay

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNDrawOverlayPackage; to the imports at the top of the file
  • Add new RNDrawOverlayPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-draw-overlay'
    project(':react-native-draw-overlay').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-draw-overlay/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      implementation project(':react-native-draw-overlay')
    

Usage

add

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

to AndroidManifest.xml

import RNDrawOverlay from 'react-native-draw-overlay';

// TODO: What to do with the module?
RNDrawOverlay.askForDispalayOverOtherAppsPermission()
	     .then(res => {
		 // res will be true if permission was granted 
	     })
	     .catch(e => {
		 // permission was declined
	     })

Readme

Keywords

Package Sidebar

Install

npm i @husam287/react-native-draw-overlay

Weekly Downloads

2

Version

1.0.0

License

none

Unpacked Size

5.97 kB

Total Files

8

Last publish

Collaborators

  • husam287