Browse Source

Add support for permission request rationale

hmatthieu 7 years ago
parent
commit
8607486644
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      index.android.js

+ 2
- 2
index.android.js View File

@@ -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])