How do I know if my iPhone is working in / quiet mode?
1 answer
Here's an example at http://www.iphonedevsdk.com/forum/iphone-sdk-development/21456-detect-wheather-phone-silent-mode-ring-mode.html
Reproduced here by Narender Mugdal :
CFStringRef route;
UInt32 propertySize = sizeof(CFStringRef);
AudioSessionInitialize(NULL, NULL, NULL, NULL);
AudioSessionGetProperty(kAudioSessionProperty_Audi oRoute, &propertySize, &route);
NSString *outputString = (NSString*)route;
//NSLog(@"%@", outputString);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message: outputString delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert show];
[alert release];
+3
source to share