views:

168

answers:

1

Hi

I need to determine if certain system settings have been set on the iphone. i.e. Whether or not particular sounds are enabled/disabled so I can decide whether or not to play sound in my own app. Is it possible to read the system settings, and if so, how?

Thanks

Fitto

A: 

You can detect if the silent switch is on or not, is this what you are after?

CFStringRef state;
UInt32 propertySize = sizeof(CFStringRef);
AudioSessionInitialize(NULL, NULL, NULL, NULL);
AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &propertySize, &state);
if(CFStringGetLength(state) > 0)
   NSLog(@"Vibration Off");
else
   NSLog(@"Vibration On");
Jamie Chapman
Thanks but I'm specifically after detecting whether keyboard clicks are enabled or not. This is so I can give my own feedback to user-defined input.
Fittoburst
I very much doubt you would be able to access that level of detail. I could be wrong though.
Jamie Chapman