|
|
@@ -43,12 +43,14 @@ class ReactNativePermissions {
|
|
|
}
|
|
|
|
|
|
request = (permission, options) => {
|
|
|
- let type = null;
|
|
|
+ let type = null
|
|
|
if (typeof options === 'string' || options instanceof Array) {
|
|
|
- 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');
|
|
|
- type = options;
|
|
|
+ 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',
|
|
|
+ )
|
|
|
+ type = options
|
|
|
} else if (options != null) {
|
|
|
- type = options.type;
|
|
|
+ type = options.type
|
|
|
}
|
|
|
|
|
|
if (!permissionTypes.includes(permission)) {
|
|
|
@@ -65,8 +67,6 @@ class ReactNativePermissions {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
return PermissionsIOS.requestPermission(
|
|
|
permission,
|
|
|
type || DEFAULTS[permission],
|