Skip to main content
Inspiring
November 22, 2013
Question

trigger iOS7 mic prompt programatically in AIR3.8

  • November 22, 2013
  • 1 reply
  • 1351 views

Hi,

I'm trying a native extension to trigger the iOS7 mic prompt but it's not showing up as I expect.

This is what I call in my native extension

    if([[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission:)])
   
{
        
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
           // blah

        
}];
   
}

Ideally I would like to be able to return whether it was granted or not. But when I tried it would always return FALSE

So then, I was just interested in triggering this popup first thing when my app starts and not handle whether the user granted access or not, but I am not seeing any popup where I call the native extension.

My app has not yet given access to the mic (I reset my device settings to ensure that and cannot see my app listed under Privacy->Microphone)

I'm using AIR3.8.

Anybody have any ideas?

Thanks!

This topic has been closed for replies.

1 reply

mu_aAuthor
Inspiring
November 22, 2013

I did indeed try that but I'm not seeing anything popup.

Did you successfully manage it in an AIR app?

mu_aAuthor
Inspiring
November 25, 2013

It would seem that my conditional if statement respondsToSelector is failing!

    if([[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission)]) {

      [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {

       }];

    }

   

And if I remove it, I can see the popup. The question is do I need this if statement? And what do we expect it to return?