My app wants to know the current mute setting of iPhone. Is there a way to achieve this? I see some solutions in google, but they don't work on my iPhone5. Any example codes or open source solutions?
As far as i know you can't access the volume apis in your application. Those are private apis . If you are access theses api by any way then also it tends to reject your application by apple .
This is how you change the volume with public api:
[[MPMusicPlayerController applicationMusicPlayer] setVolume:currentVolume];
But to mute it I don't think there really is a public API.
Related
I have been able to decrease the volume of Ringer by using AVSystemController's setVolume method. However, it doesn't mute the device, there is still 5% volume left. I might need to control the Silent switch but didn't find anything about it.
Please note I don't want answers like The app will be rejected by Apple as I do not intend it to upload.
It is technically possible to change the system volume through the private AVSystemController class in Celestial.framework
Get Framework from here.
I'd like to show a list of available wifi in my next app, similar to iHome Connect. http://itunes.apple.com/us/app/ihome-connect-setup-app-for/id450241802?mt=8
I've done some googling and have found out that the only way to do this is to use a private API (illegal), but there are apps in the app store that are doing this?
Has anyone had the need to do this? If so, what private API did you use and was your app rejected?
It is possible using private API and your app will likely be rejected.
Stumbler helper library: http://code.google.com/p/iphone-wireless/
I know this question is already asked quite some time. And I read all the topics at stackoverflow.
But there isn't a satisfying answer to my problem.
I'd like to mute my iPhone running iOS 5 programmatically. Many would say it isn't possible with public frameworks. I'm aware of that. The App I'm planning to code is for personal use only. I do not intend to sell it over the AppStore (yet?).
My research brought me to the conclusion, that there my be several ways to achieve muting an iPhone programmatically.
Use private frameworks
Hook functions or methods which are playing sounds
Replace default sounds (like ringtone, MailSent, iMessage, usw...)
Some thoughts to the above mentioned methods:
I class-dumped all headers of the private frameworks (in my Xcode-Installation) and didn't find functions which indicate (by their function name) to the wanted behavior
I think it's possible, but I do not know the functions to be hooked. Therefore, it would be quite some effort for to make this work (and I think I do not want to do this)
Giving it a second thought, this might not be a good solution. Maybe you can change the sounds. But then the phone isn't mute at all (games, YouTube,...)
I had given AVSystemController a chance using the methods changeActiveCategoryVolumeBy and setVolumeTo but those won't mute my phone but set the minimal volume of the ringer to 0.06 (or something).
There has to be a way to completely mute the iPhone, RingToggle (jailbroken app) is doing it quite good.
Does anyone has a idea how to do it?
I don't think you'll be able to mute the phone from a sandboxed app, even using private frameworks.
What RingToggle probably does is hook into the springboard and use springboard's methods to mute the phone; they are probably using a MobileSubstrate extension.
I couldn't find it in the documentation, so I'd ask: is there a way to get/set the ringtone for a specific user in the address book (programatically, of course)?
No, there isn't an official API to do that. Submiting a feature request is all you can do.
I've seen techniques to make sure that an app respects the mute switch, but is it possible to set the iPhone to mute (no sounds from any apps) using the SDK?
No.
Applications developed using the official SDK cannot change (and in most cases cannot even access) system-wide settings.
It is possible, but only using private API's. I only went as far as muting the ringer, but you should be able to control the master level as well.
See How to disable iOS System Sounds
It is technically possible to change the system volume through the private AVSystemController class in Celestial.framework, but will prevent your app from getting Apple's approval
As only one app can be running at a time, the only possible use I can think of for this would be to mute other people's apps, and it should be fairly clear why Apple prevents that.
What would I do if an app muted the iPhone and I didn't know it happened? It can't physically move the mute switch on the side of the phone, so that wouldn't match, and I'd have to figure out a) that the phone was muted and b) how to unmute it without the switch.
I can change volume using AVSystemController, it sets to minimum which is 0.06x. Is there class/API to mute it completely? toggleActiveCategoryMuted does not work