Created
May 20, 2014 15:26
-
-
Save akinLiu/9bc270cadb4d005f43c3 to your computer and use it in GitHub Desktop.
检测麦克风可用状态
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ([[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission:)]) { | |
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) { | |
if (!granted) { | |
//检测到不可用 | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
//回到主线程做出相应提示 | |
}); | |
} | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment