Compare View

switch
from
...
to
 
Commits (2)

Changes

Showing 6 changed files Side-by-side Diff

android/src/main/java/com/reactnativecommunity/rnpermissions/RNPermissionsModule.java
... ... @@ -254,7 +254,7 @@ public class RNPermissionsModule extends ReactContextBaseJavaModule {
254 254 }
255 255  
256 256 @ReactMethod
257   - public void requestOverlayAndroid(final Promise promise) {
  257 + public void requestOverlayPermission(final Promise promise) {
258 258 // Check if Android M or higher
259 259 final ReactApplicationContext reactContext = getReactApplicationContext();
260 260 if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M && !Settings.canDrawOverlays(reactContext)) {
... ... @@ -13,7 +13,7 @@ export interface Contract {
13 13  
14 14 checkOverlayAndroid(): Promise<boolean>;
15 15  
16   - requestOverlayAndroid(): Promise<PermissionStatus>;
  16 + requestOverlayPermission(): Promise<PermissionStatus>;
17 17  
18 18 request(
19 19 permission: Permission,
... ... @@ -15,7 +15,7 @@ export * from &#39;./types&#39;;
15 15 export const openSettings = module.openSettings;
16 16 export const check = module.check;
17 17 export const checkOverlayAndroid = module.checkOverlayAndroid;
18   -export const requestOverlayAndroid = module.requestOverlayAndroid;
  18 +export const requestOverlayPermission = module.requestOverlayPermission;
19 19 export const request = module.request;
20 20 export const checkNotifications = module.checkNotifications;
21 21 export const requestNotifications = module.requestNotifications;
... ... @@ -28,7 +28,7 @@ export default {
28 28 openSettings,
29 29 check,
30 30 checkOverlayAndroid,
31   - requestOverlayAndroid,
  31 + requestOverlayPermission,
32 32 request,
33 33 checkNotifications,
34 34 requestNotifications,
src/module.android.ts
... ... @@ -17,7 +17,7 @@ const RNP: {
17 17 openSettings: () => Promise<true>;
18 18 checkOrRequestOverlayPermission: () => Promise<true>;
19 19 checkOverlayAndroid: () => Promise<boolean>;
20   - requestOverlayAndroid: () => Promise<PermissionStatus>;
  20 + requestOverlayPermission: () => Promise<PermissionStatus>;
21 21 getNonRequestables: () => Promise<Permission[]>;
22 22 isNonRequestable: (permission: Permission) => Promise<boolean>;
23 23 setNonRequestable: (permission: Permission) => Promise<true>;
... ... @@ -74,9 +74,9 @@ async function checkOverlayAndroid(): Promise&lt;boolean&gt; {
74 74 return await RNP.checkOverlayAndroid();
75 75 }
76 76  
77   -async function requestOverlayAndroid(): Promise<PermissionStatus> {
78   - console.warn("check requestOverlayAndroid ts")
79   - const output = await RNP.requestOverlayAndroid()
  77 +async function requestOverlayPermission(): Promise<PermissionStatus> {
  78 + console.warn("check requestOverlayPermission ts")
  79 + const output = await RNP.requestOverlayPermission()
80 80 if (output.status == RESULTS.GRANTED) {
81 81 return RESULTS.GRANTED
82 82 } else if (output.status == RESULTS.BLOCKED) {
... ... @@ -182,7 +182,7 @@ export const module: Contract = {
182 182 openSettings,
183 183 check,
184 184 checkOverlayAndroid,
185   - requestOverlayAndroid,
  185 + requestOverlayPermission,
186 186 request,
187 187 checkNotifications,
188 188 requestNotifications: checkNotifications,
... ... @@ -46,7 +46,7 @@ async function checkOverlayAndroid(): Promise&lt;boolean&gt; {
46 46 return true;
47 47 }
48 48  
49   -async function requestOverlayAndroid(): Promise<PermissionStatus> {
  49 +async function requestOverlayPermission(): Promise<PermissionStatus> {
50 50 return RESULTS.UNAVAILABLE;
51 51 }
52 52  
... ... @@ -94,7 +94,7 @@ export const module: Contract = {
94 94 openSettings,
95 95 check,
96 96 checkOverlayAndroid,
97   - requestOverlayAndroid,
  97 + requestOverlayPermission,
98 98 request,
99 99 checkNotifications,
100 100 requestNotifications,
... ... @@ -10,7 +10,7 @@ async function checkOverlayAndroid(): Promise&lt;boolean&gt; {
10 10 return true;
11 11 }
12 12  
13   -async function requestOverlayAndroid(): Promise<PermissionStatus> {
  13 +async function requestOverlayPermission(): Promise<PermissionStatus> {
14 14 return RESULTS.UNAVAILABLE;
15 15 }
16 16  
... ... @@ -32,7 +32,7 @@ export const module: Contract = {
32 32 openSettings: Promise.reject,
33 33 check,
34 34 checkOverlayAndroid,
35   - requestOverlayAndroid,
  35 + requestOverlayPermission,
36 36 request: check,
37 37 checkNotifications,
38 38 requestNotifications: checkNotifications,