国外大牛写的检查手机静音的方法-----SoundSwitch
void SharkfoodSoundMuteNotificationCompletionProc(SystemSoundID ssID,void* clientData); // sound completion proc
/** ... **/
if (AudioServicesCreateSystemSoundID((__bridge CFURLRef)url, &_soundId) == kAudioServicesNoError){
AudioServicesAddSystemSoundCompletion(self.soundId, CFRunLoopGetMain(), kCFRunLoopDefaultMode, SharkfoodSoundMuteNotificationCompletionProc,(__bridge void *)(self));
}
链接: https://pan.baidu.com/s/1SvMS2vHJnanR7P_-9S7LEw
提取码: cjzc