0

I want to get the iPOD/iPHONE "Ringer and Alert" device volume from setting->sounds section. i am able to get the device volume but not the ringer and alert volume.

Please can someone help me to solve this.

Thanks in advance.

Mohammed Irfan
  • 261
  • 1
  • 3
  • 4

1 Answers1

0

Try this

[[NSNotificationCenter defaultCenter] addObserver:self
                                     selector:@selector(volumeChanged:)
                                         name:@"AVSystemController_SystemVolumeDidChangeNotification"
                                       object:nil];

- (void)volumeChanged:(NSNotification *)notification
{
    NSDictionary*dict=notification.userInfo;
    float newVolume =
    [[dict objectForKey:@"AVSystemController_AudioVolumeNotificationParameter"]floatValue];
    // newVolume is value that you need
}

Read further information here and here.

Community
  • 1
  • 1
Blind Ninja
  • 1,063
  • 13
  • 28
  • Thank you for the quick reply. I tried this code, which will give me device volume not the Ringer and Alert volume. If i keep both the volume different and run the code. will always give the device volume. – Mohammed Irfan Aug 17 '15 at 10:06