Iphone App auto volume - iphone

Is it possible to have an iphone app that:
Allows you to silence phone and automatically turn ringer back on after a set amount of time?
Or
Lowers ringer volume to 0 and then automatically turn ringer back up after a set amount of time?
Thanks, All answers will be appreciated

Check out this post:
How to programmatically silence the ringer or change the ringer tone on iOS5

Related

Will an NSLocalNotification Sound Play When the Phone is set to Silent?

Is it possible for an NSLocalNotification to play an audio file when the ringer switch is set to OFF?
No. NSLocalNotification must adhere to the device's real world settings.

iPhone alarm clock progressive music alert + volume control

I am working on a custom iPhone alarm clock.
Some users have slept in when the device is on silent and locked.
I know that the top iPhone alarms ('Smart Alarm Clock Free', 'Living Earth', 'Rise') can manually control and increase the volume if the App is in the foreground before the user locks their device.
Does anyone know how it is possible to navigate around silent mode?
When configuring your audio session simply use the AVAudioSessionCategoryPlayback category. From the docs:
AVAudioSessionCategoryPlayback or the equivalent kAudioSessionCategory_MediaPlayback—Use this category for an application whose audio playback is of primary importance. Your audio plays even with the screen locked and with the Ring/Silent switch set to silent.
Details about the different audio session categories and how to set them can be found here.
it isn't possible. The hardware switch that turns ios to silent mode cant be overriden by ios apps
(as always jailbreak'd iPhones are excluded :D)

How to increase iPhone volume programmatically

In my app I have to play the siren sound on tapping the button, I can able to play it when ringer volume is set to some value, but my problem is when user kept their ringer volume to zero, how can I play it with maximum sound?
Officially you can't do this. As a smartphones user, I wouldn't appreciate to set my volume at 10% and have an app that rings at max volume.
You can however try to use Celestial.framework, but your application will be rejected from the App Store.
try this code ,it only work in device
[[MPMusicPlayerController applicationMusicPlayer] setVolume:setvalue];

AudioServicesPlaySystemSound volume control

I wanted to ask if there is any way to control the volume of the system sound effect. When I press the volume control toggle (up and down) in the game, the system sound effects does not get affected. I also read that this should be affected by the ringer volume. But the weird thing is that when I press the volume up and down, I do not see the little ringer text on top of the speaker icon. I only see the speaker icon without ringer on top when I press the volume control. Does anyone know why?
Thanks.
If audio is playing on your device using audioQueue, iPod or some other form other than system sounds, the volume adjusted by the side buttons will be the device volume. If the device is otherwise silent, adjusting the side buttons will adjust the ringer volume.
if you want to affected,you can use this
[[AVAudioSession sharedInstance]
setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker
error:nil];

MPVolume on ipodtouch/iphone

i'm using the code of this link: http://blog.stormyprods.com/2008/09/proper-usage-of-mpvolumeview-class.html
it is working on an ipod touch, but NOT on iphones.
what can be the reason for that?
Two things:
I think iPhone OS 3.0 does a better job of syncing the MPVolumeView slider with changes to the system volume received from the buttons on side. So the workaround on that blog (listening for NSNotifications) may no longer be necessary.
On the iPhone, volume changes are contextual. If your app is currently playing sound, then hitting the volume buttons (or, presumably, MPVolumeView) affects the volume level of your app's audio. But if your app isn't producing sound, then you are just changing the ringer volume. This might explain why your current code works on touches, which don't have ringers.