Skip to content

Android Do not ask again value is wrong (Should be 'blocked' but is returned 'denied')  #419

@asavardplante

Description

@asavardplante

Bug

Do not ask again should returns blocked value if it is selected, but returns denied instead.

Environment info

react: 16.8.3 => 16.8.3
react-native: 0.59.9 => 0.59.9

Library version: ^2.0.9

Describe what you expected to happen:

  1. Asking Android's permission to use the Microphone.
  2. Select do not ask me again and then refuse, which is the only option left.
  3. check(permission) should return Blocked but returns Denied

Reproducible sample code

const toggleRecording = async () => {
    if (recording) {
      return setRecording(!recording)
    }

    const permission = await check(permissionPerPlatform)
    
    if (permission === RESULTS.DENIED) {
      return askRecordAudioPermission();
    }

    if (permission === RESULTS.BLOCKED) {
      return (
        Alert.alert(
          I18n.t("sharedMessaging.audio.permissions.title"),
          I18n.t("sharedMessaging.audio.permissions.text"),
          [
            { text: I18n.t("sharedMessaging.audio.permissions.action") },
          ],
          { cancelable: false },
        )
      );
    }

    setRecording(!recording)
  };

  const askRecordAudioPermission = async () => await request(permissionPerPlatform);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions