Przeglądaj źródła

Add support for permission request rationale

hmatthieu 7 lat temu
rodzic
commit
8607486644
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2
    2
      index.android.js

+ 2
- 2
index.android.js Wyświetl plik

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