瀏覽代碼

Add support for permission request rationale

hmatthieu 7 年之前
父節點
當前提交
8607486644
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      index.android.js

+ 2
- 2
index.android.js 查看文件

@@ -60,12 +60,12 @@ class ReactNativePermissions {
60 60
 	}
61 61
 
62 62
 
63
-	request(permission) {
63
+	request(permission, rationale) {
64 64
 		const androidPermission = RNPTypes[permission]
65 65
   	if (!androidPermission) return Promise.reject(`ReactNativePermissions: ${permission} is not a valid permission type on Android`);
66 66
 
67 67
 
68
-		return RNPermissions.request(androidPermission)
68
+		return RNPermissions.request(androidPermission, rationale)
69 69
 			.then(res => {
70 70
 				return setDidAskOnce(permission)
71 71
 					.then(() => RESULTS[res])