Microphone resolution not working as intended

I am working on an application that requires microphone access / recording. So far, I thought my permission handling was working, but my TestFlight beta testers are unable to use the microphone feature even though it works in test devices for the simulator and iOS7.

Here is my access code:

AVAudioSession *session = [AVAudioSession sharedInstance];
    if ([session respondsToSelector:@selector(requestRecordPermission:)]) {
        [session performSelector:@selector(requestRecordPermission:) withObject:^(BOOL granted) {
            if (granted) {
                //granted
            }
            else {
                //not granted
                }
        }
        ];
    }else{
        //iOS6 seems to be missing this feature -> always available
    }

      

I can't reproduce the prompt, even with the privacy and location reset on the simulator means the prompt never appears. However, I can work with the microphone on the simulator as if permission had been granted.

The important thing is that the app is NOT listed in the Privacy section as a microphone access app (which obviously should).

If I print the iOS8 flag [AvAudioSession sharedInstance].recordPermission

it is always AVAudioSessionRecordPermissionUndetermined

even after the above permission request is completed with the granted.

Short part of the test code:

[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
        NSLog(@"GRANTED: %i", granted);
    }];
    NSLog(@"RECORD PERMISSION: %i", [AVAudioSession sharedInstance].recordPermission == AVAudioSessionRecordPermissionUndetermined?1:0);

      

produces the output for me: "GRANTED: 1" "WRITE RECORD: 1", which should be impossible, right?

Currently he cannot use my iOS8 app.

+3


source to share


1 answer


The simulator does not ask for permission to access the microphone, or does not list them in the Privacy section. It just lets you work with audio recording. You should check this on a real device, which I am afraid of.



Related answer: requestRecordPermission does nothing

+1


source







All Articles