Skip to content

Instantly share code, notes, and snippets.

@Air-Craft
Created April 26, 2015 13:55
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Air-Craft/cd95f99245294206652a to your computer and use it in GitHub Desktop.
Save Air-Craft/cd95f99245294206652a to your computer and use it in GitHub Desktop.
Short custom vibration on iPhone #ios #vibration #private-api
// Headers
#import <AudioToolbox/AudioToolbox.h>
void AudioServicesStopSystemSound(SystemSoundID inSystemSoundID);
void AudioServicesPlaySystemSoundWithVibration(SystemSoundID inSystemSoundID,id arg,NSDictionary* vibratePattern);
// Buzz code
NSArray *vibe = @[ @YES, @10 ]; // ON for 10ms
NSDictionary *dict = @{ @"Intensity": @0.1, @"VibePattern": vibe };
AudioServicesPlaySystemSoundWithVibration(kSystemSoundID_Vibrate,nil,dict);
// [self bk_performBlock:^(id obj) {
// AudioServicesStopSystemSound(kSystemSoundID_Vibrate);
// } afterDelay:1];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment