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

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

jtree - comparing two TreeNode (or DefaultMutableTreeNode) objects in Java Comparator -