Necesito detectar cuando el usuario presiona las teclas de volumen de hardware, (enfoque seguro de App Store) He intentado varias cosas sin suerte. ¿Sabes cómo implementar tal funcionalidad? Actualmente me estoy registrando para recibir notificaciones, sin embargo, parece que no se las llama. Aquí está mi código:iPhone Detect Volume Keys presione.
AudioSessionInitialize(NULL, NULL, NULL, NULL);
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self
selector:@selector(volumeChanged:)
name:@"AVSystemController_SystemVolumeDidChangeNotification"
object:nil];
Y el método del receptor es:
-(void)volumeChanged:(NSNotification *)notification{
NSLog(@"YAY, VOLUME WAS CHANGED");}
Cualquier consejo sería muy apreciada.
mira aquí: http://stackoverflow.com/questions/772832/program-access-to-iphone- botones de volumen – mja