0

I'm a new developer and would like to know how to silent/vibrate an IOS device through code(swift2), I don't care if it requires a private API. Please help.

1 Answers1

0

You'll need to import the System Sound Services

import AudioToolbox.AudioServices

Then you can play the vibration alert "sound"

AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate))

More information can be found in the Apple docs: https://developer.apple.com/library/prerelease/ios/documentation/AudioToolbox/Reference/SystemSoundServicesReference/index.html

Adolfo
  • 4,969
  • 4
  • 26
  • 28