瀏覽代碼

Merge pull request #163 from convoyinc/v1.0.1

Fixed request logic for OS versions prior to Android M (6.0 that is)
Yonah Forst 7 年之前
父節點
當前提交
0ecbb90bf5
共有 1 個檔案被更改,包括 3 行新增0 行删除
  1. 3
    0
      index.android.js

+ 3
- 0
index.android.js 查看文件

@@ -70,6 +70,9 @@ class ReactNativePermissions {
70 70
 
71 71
 		return RNPermissions.request(androidPermission)
72 72
 			.then(res => {
73
+				// RNPermissions.request() to native module resolves to boolean
74
+				// rather than string if running on OS version prior to Android M 
75
+				if (typeof res === 'boolean') return res ? 'authorized' : 'denied';
73 76
 				return setDidAskOnce(permission)
74 77
 					.then(() => RESULTS[res])
75 78
 			});