Ver código fonte

Add support for permission request rationale

hmatthieu 7 anos atrás
pai
commit
8607486644
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2
    2
      index.android.js

+ 2
- 2
index.android.js Ver arquivo

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