Permissions.AUDIO_RECORDING not working

#1

All the permissions are working for me except Permissions.AUDIO_RECORDING.

Here is my function:

async handlePress() {
const { status } = await Permissions.askAsync(Permissions.AUDIO_RECORDING);
if (status === ‘granted’) {
const recording = new Audio.Recording();
try {
await recording.prepareToRecordAsync(
Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY,
);
await recording.startAsync();
// You are now recording!
} catch (error) {
// An error occurred!
}
}
throw new Error(‘Audio permission not granted’);
}

Any chance anyone has an idea of what could be going on here?

0 Likes

#2

Hey @bullthistle,

We are going to need some more information to help with this issue. For instance, what do you mean by “not working”? The permission is not being ask for? The permission is granted, but the Audio API isn’t working? Also, what SDK are you running and on what platform(s)?

Cheers,

Adam

0 Likes

#3

Sorry, I should have included that. The permission is not being asked for.

Expo and react versions:
“expo”: “^29.0.0”,
“react”: “16.3.1”,
“react-native”: “https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz

0 Likes

#4

Running on iphoneX

0 Likes

#5

Got it. Thanks for the information!

Are you positive the permission hasn’t already been asked for? As on iOS, a permission can only be prompted for once.

Cheers,

Adam

0 Likes

closed #6

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

0 Likes