@@ -315,6 +315,7 @@ public void checkMultiplePermissions(final ReadableArray permissions, final Prom
315315 public void requestMultiplePermissions (final ReadableArray permissions , final Promise promise ) {
316316 final WritableMap output = new WritableNativeMap ();
317317 final ArrayList <String > permissionsToCheck = new ArrayList <String >();
318+ int checkedPermissionsCount = 0 ;
318319
319320 Context context = getReactApplicationContext ().getBaseContext ();
320321
@@ -323,23 +324,28 @@ public void requestMultiplePermissions(final ReadableArray permissions, final Pr
323324
324325 if (!permissionExists (permission )) {
325326 output .putString (permission , UNAVAILABLE );
327+ checkedPermissionsCount ++;
326328 } else if (Build .VERSION .SDK_INT < Build .VERSION_CODES .M ) {
327329 output .putString (
328330 permission ,
329331 context .checkPermission (permission , Process .myPid (), Process .myUid ())
330332 == PackageManager .PERMISSION_GRANTED
331333 ? GRANTED
332334 : BLOCKED );
335+
336+ checkedPermissionsCount ++;
333337 } else if (context .checkSelfPermission (permission ) == PackageManager .PERMISSION_GRANTED ) {
334338 output .putString (permission , GRANTED );
339+ checkedPermissionsCount ++;
335340 } else if (mSharedPrefs .getBoolean (permission , false )) {
336341 output .putString (permission , BLOCKED ); // not supporting reset the permission with "Ask me every time"
342+ checkedPermissionsCount ++;
337343 } else {
338344 permissionsToCheck .add (permission );
339345 }
340346 }
341347
342- if (permissionsToCheck . isEmpty () ) {
348+ if (permissions . size () == checkedPermissionsCount ) {
343349 promise .resolve (output );
344350 return ;
345351 }
0 commit comments