I am using following code to check iPhone silent switch is ON or OFF :-
if (self)
{
self.detector = [SharkfoodMuteSwitchDetector shared];
CheckInViewController* sself = self;
self.detector.silentNotify = ^(BOOL silent)
{
[sself.silentSwitch setOn:silent animated:YES];
};
}
It works fine in iOS 6 and below but in iOS 7 it always gives TRUE value. So, Please any one tell, how to resolve this issue.
Thanks in advance.
It doesn't work in iOS 7, and it never really worked in iOS 6 if you look at why it doesn't work in iOS 7. This solution is based on the same code, so all credit to the original author though.
mute.caf
from your SharkfoodMuteSwitchDetector.In the header file:
In the implementation file:
Use like so: