Browse Source

use indexOf for list

king6cong 8 years ago
parent
commit
aaa257fc99
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      ReactNativePermissions.ios.js

+ 1
- 1
ReactNativePermissions.ios.js View File

46
 	}
46
 	}
47
 
47
 
48
         getPermissionStatus(permission) {
48
         getPermissionStatus(permission) {
49
-		if (permission in RNPTypes) {
49
+               if (RNPTypes.indexOf(permission) >= 0) {
50
 			return RNPermissions.getPermissionStatus(permission)
50
 			return RNPermissions.getPermissionStatus(permission)
51
 		} else {
51
 		} else {
52
 			return Promise.reject(`ReactNativePermissions: ${permission} is not a valid permission type`)
52
 			return Promise.reject(`ReactNativePermissions: ${permission} is not a valid permission type`)