|
@@ -43,7 +43,15 @@ class ReactNativePermissions {
|
43
|
43
|
return RNPermissions.getPermissionStatus(permission, type);
|
44
|
44
|
}
|
45
|
45
|
|
46
|
|
- request(permission, type) {
|
|
46
|
+ request(permission, options) {
|
|
47
|
+ let type = null;
|
|
48
|
+ if (typeof options === 'string' || options instanceof Array) {
|
|
49
|
+ console.warn('[react-native-permissions] : You are using a deprecated version of request(). You should use an object as second parameter. Please check the documentation for more information : https://github.com/yonahforst/react-native-permissions');
|
|
50
|
+ type = options;
|
|
51
|
+ } else {
|
|
52
|
+ type = options.type;
|
|
53
|
+ }
|
|
54
|
+
|
47
|
55
|
if (!RNPTypes.includes(permission)) {
|
48
|
56
|
return Promise.reject(`ReactNativePermissions: ${permission} is not a valid permission type on iOS`);
|
49
|
57
|
}
|