I'm making an SBSettings toggle that will put the iPhone into silent mode. I've already made it about 90% completed, but I'm missing one thing. That's changing and updating the Ringtone, and also making sure that SpringBoard knows that it's been changed.
For example,
the App edits:
/var/mobile/Library/Preferences/com.apple.springboard.plist
and changes the Ringtone value to a silent ringtone file.
You can verify that the ringtone has been changed by going into Settings - Sounds - Ringtone. You can see that the ringtone is now changed to the new value. However, when the iPhone is been called, the new ringtone does not play.
There's a way to update the Location Preference, and I'm trying to adapt that to change the Ringtone Preference.
LocationD preference update:
Code:
notify_post("com.apple.locationd/Prefs");
And language update is:
Code:
notify_post("com.apple.language.changed");
I'm thinking that the way to update the ringtone would be something like this:
Code:
notify_post("com.apple.springboard/Prefs");
notify_post("com.apple.springboard/Ringtone");
notify_post("com.apple.ringtone.changed");
Any experienced objective-C users have any ideas?