How to find out if the iPhone is on silent mode? -
i have mailing application. if user sends mail successfully, need notify mail sent successfully. that, need know if phone on silent mode (in case there 'vibrate') or regular mode (in case there 'beep'). can me it?
thanks in advance
cfstringref state; uint32 propertysize = sizeof(cfstringref); audiosessioninitialize(null, null, null, null); audiosessiongetproperty(kaudiosessionproperty_audioroute, &propertysize, &state); if(cfstringgetlength(state) == 0) { //silent } else { //not silent }
if state string empty phone on silent - otherwise phone has audio output
edit:
remember add audiotoolbox framework , import. – thomas clayson
answer taken (http://iphone-dev-tips.alterplay.com/2009/12/iphone-silent-mode-detection.html)
Comments
Post a Comment