Browse Source

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 years ago
parent
commit
0ecbb90bf5
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      index.android.js

+ 3
- 0
index.android.js View File

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
 			});