Is there a way to determine the setting of the Ring/Silent switch on the iPhone -


i trying figure out code whether ring/silent switch on ring or silent. there way determine program.

thanks

i did more searching , found same question here how detect iphone on silent mode.

for completeness, here answer neil worked me?

cfstringref state = nil; uint32 propertysize = sizeof(cfstringref); audiosessioninitialize(null, null, null, null); osstatus status = audiosessiongetproperty(kaudiosessionproperty_audioroute, &propertysize, &state);  if (status == kaudiosessionnoerror) {      return (cfstringgetlength(state) == 0);   // yes = silent } return no; 

it should noted not work if headphones connected. "headphone". reported coob.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -