11

I found out "Silent switch" status of Device using "AudioSessionGetProperty" before [iOS5] released.

CFStringRef route;
UInt32 propertySize = sizeof(CFStringRef);
AudioSessionInitialize(NULL, NULL, NULL, NULL);
AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &propertySize, &route);
if(CFStringGetLength(route) == 0) {
     // Silent Mode
}

Now, I'd like to know how to get "silent switch" status in "iOS5"

karllindmark
  • 6,031
  • 1
  • 26
  • 41
user1000213
  • 111
  • 3

1 Answers1

2

It's not possible. I've asked the question directly to Apple using a Developer Technical Support, and they answered me that the way that was made possible prior to iOS 5 was because of a breach, that was corrected in iOS 5. They say it's not made possible anymore, and if we want such a feature, we have to ask for it.

Oliver
  • 23,072
  • 33
  • 138
  • 230
  • 1
    It's definitely possible, even in iOS5. Look at this (paid...) component. But I wanna figure that out, not pay for closed source stuff. http://www.cocoacontrols.com/platforms/ios/controls/vssilentswitch – steipete Apr 01 '12 at 07:13
  • @steipete:very very very interesting ! – Oliver Apr 01 '12 at 18:55
  • The component does some trick with playing a silent track and evaluating something. It has 1-2 seconds delay. Definitely a very crude hack. – steipete Apr 02 '12 at 05:07