RequestRecordPermission does nothing

Since the iOS 7 update, there have been some changes to the recording apps. I have an application that was used to work with iOS 5 and 6, but when I tried to run it on iOS 7, the recording did not respond.

I checked the Internet and saw a new method there that needs to be called. I tried putting this code in viewDidAppear:

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { if([[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission:)]) { [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) { NSLog(@"permission : %d", granted); }]; } } 

'given' is always 1, although I did not grant any permissions and did not see the request popup.

Btw I'm trying to handle this using xcode 4.6.3. I made a category for AVAudioSession with the requestRecordPermission method, since this method is only available in iOS 7.

Thank.

+13
ios ios7 record permissions avaudiosession
Sep 23 '13 at 11:03
source share
4 answers

I ran into the same problem when testing on the iOS7 simulator, it seems that requestRecordPermission does not work in the simulator, and the β€œprovided” always returns YES. You must test it on a real device.

If you tested it once on the device and responded to the permission pop-up window, the permission pop-up window will not appear again until the location and privacy are reset.

In reset Location and Privacy follow these steps

 Go to Settings -> General -> Reset -> Reset Location & Privacy and then press "Reset Warnings" when asked. 
+25
Oct. 16 '13 at 7:31 on
source share

After you have granted permission for audio for the application. Your application will not again ask for confirmation.

If you want to test it, change the package identifier of your application and try.

+10
07 Oct '13 at 13:14
source share

for iOS 8 Simulator. AVAudioSession.sharedInstance().requestRecordPermission always returns true. On the other hand, when you call

 UIApplication.sharedApplication().openURL(NSURL(string: UIApplicationOpenSettingsURLString)!) 

To open the settings of your application on the simulator, the microphone is never displayed there. This must be tested on a real device.

+2
Jul 22 '15 at 20:25
source share

Add privacy - use the microphone Description in your information plist to provide access for the application to request permission. This caused a Thread13 error: SIGABRT signal. After that, the error will be resolved automatically.

+1
Dec 27 '16 at 11:41
source share



All Articles