瀏覽代碼

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 8 年之前
父節點
當前提交
0ecbb90bf5
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3
    0
      index.android.js

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

70
 
70
 
71
 		return RNPermissions.request(androidPermission)
71
 		return RNPermissions.request(androidPermission)
72
 			.then(res => {
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
 				return setDidAskOnce(permission)
76
 				return setDidAskOnce(permission)
74
 					.then(() => RESULTS[res])
77
 					.then(() => RESULTS[res])
75
 			});
78
 			});