ios7新增api requestRecordPermission
api 说明:
- (void)requestRecordPermission:(PermissionBlock)response
Description
Request the user’s permission for audio recording.
Recording audio requires explicit permission from the user. The system automatically prompts the user for permission if you use any session categories that enable recording, or you can call this method to prompt for permission at a time of your choosing. After the user grants or denies permission, the system remembers the choice for future use in the same app. If permission is not granted, or if the user has not yet responded to the permission prompt, any audio recording sessions record only silence.
The response parameter is a block of the PermissionBlock type, whose sole parameter indicates whether the user granted or denied permission to record. This method always returns immediately: if the user has previously granted or denied recording permission, it executes the block when called; otherwise, it displays an alert and executes the block only after the user has responded to the alert.
Parameters
response
A block to be called when recording permission has been granted or denied.
Availability iOS (7.0 and later)
新增api,获取录音权限.
返回值,YES为无拒绝,NO为拒绝录音.
-(BOOL)canRecord
{