How can I get ringer volume on iphone using AVSystemController
I also tried under the code to check the volume level
MPVolumeView *slide = [MPVolumeView new];
UISlider *volumeViewSlider;
for (UIView *view in [slide subviews]){
if ([[[view class] description] isEqualToString:@"MPVolumeSlider"]) {
volumeViewSlider = (UISlider *) view;
}
}
float val = [volumeViewSlider value];
But when I print / check val, it returns 1.00
I also tried under the code
musicPlayer = [MPMusicPlayerController applicationMusicPlayer];
Nslog(@"%f",musicPlayer.volume);
But it also returns event 1.00 if my phone is down. I link below the link
How to determine the current call level of the iPhone? but I could not find a solution.
Please, help.
Vidhi source
share