Created
April 3, 2015 11:04
-
-
Save daehn/6bcecbadb9c77011935b to your computer and use it in GitHub Desktop.
Custom iOS vibration pattern with 100ms duration using 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
NSMutableDictionary *vibrationParameters = [[NSMutableDictionary alloc] init]; | |
vibrationParameters[@"VibePattern"] = @[@YES, @100]; | |
vibrationParameters[@"Intensity"] = @1; | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wimplicit-function-declaration" | |
AudioServicesStopSystemSound(kSystemSoundID_Vibrate); | |
AudioServicesPlaySystemSoundWithVibration(kSystemSoundID_Vibrate, nil, vibrationParameters); | |
#pragma clang diagnostic pop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment