Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Ask for draw over other apps permission.
implementation project(':react-native-draw-overlay')
```
## Usage
add
add
```xml
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
```
Expand All @@ -37,12 +37,11 @@ to AndroidManifest.xml
import RNDrawOverlay from 'react-native-draw-overlay';

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

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public String getName() {


@ReactMethod
public void askForDispalayOverOtherAppsPermission(Promise promise) {
public void askForDisplayOverOtherAppsPermission(Promise promise) {
mPromise = promise;
if (!Settings.canDrawOverlays(this.reactContext)) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + this.reactContext.getPackageName()));
Expand All @@ -67,4 +67,4 @@ public void askForDispalayOverOtherAppsPermission(Promise promise) {
promise.resolve(true);
}
}
}
}