-
-
Save emaalouf/7b7a7a8685e718c4bc7a32bb27843942 to your computer and use it in GitHub Desktop.
Short custom vibration on iPhone #ios #vibration #private-api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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