I think the following code can do the trick. You need to initiate this from somewhere, though (I donβt understand if you want it to be launched using the button or from the application).
NSString *sbPath = @"/var/mobile/Library/Preferences/com.apple.springboard.plist"; NSMutableDictionary *sbDict = [[NSMutableDictionary alloc] initWithContentsOfFile:sbPath]; [sbDict setValue:[NSNumber numberWithBool:NO] forKey:@"silent-vibrate"]; [sbDict writeToFile:filePath atomically: YES]; notify_post("com.apple.SpringBoard/Prefs");
I have not tried it myself, but found something like what you are looking for in Smartvibrate setup. This will change the parameter setting, so you must change it to turn on when your application ends.
Hope this helps!
Panagiotis
source share