Mathieu Acthernoene hace 7 años
padre
commit
1a3c1a9ef1
Se han modificado 2 ficheros con 13 adiciones y 9 borrados
  1. 1
    1
      index.android.js
  2. 12
    8
      index.ios.js

+ 1
- 1
index.android.js Ver fichero

@@ -93,4 +93,4 @@ class ReactNativePermissions {
93 93
     )
94 94
 }
95 95
 
96
-export default new ReactNativePermissions()
96
+module.exports = new ReactNativePermissions()

+ 12
- 8
index.ios.js Ver fichero

@@ -36,7 +36,10 @@ class ReactNativePermissions {
36 36
       )
37 37
     }
38 38
 
39
-    return PermissionsIOS.getPermissionStatus(permission, type)
39
+    return PermissionsIOS.getPermissionStatus(
40
+      permission,
41
+      type || DEFAULTS[permission],
42
+    )
40 43
   }
41 44
 
42 45
   request = (permission, type) => {
@@ -61,13 +64,14 @@ class ReactNativePermissions {
61 64
   }
62 65
 
63 66
   checkMultiple = permissions =>
64
-    Promise.all(permissions.map(this.check)).then(result =>
65
-      result.reduce((acc, value, index) => {
66
-        const name = permissions[index]
67
-        acc[name] = value
68
-        return acc
69
-      }, {}),
67
+    Promise.all(permissions.map(permission => this.check(permission))).then(
68
+      result =>
69
+        result.reduce((acc, value, index) => {
70
+          const name = permissions[index]
71
+          acc[name] = value
72
+          return acc
73
+        }, {}),
70 74
     )
71 75
 }
72 76
 
73
-export default new ReactNativePermissions()
77
+module.exports = new ReactNativePermissions()