Vibrate Error Message

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Posts: 30
Joined: Sun Feb 28, 2010 9:52 pm
Location: Miami, Florida

Vibrate Error Message

Post by Redlance305 » Sun Nov 14, 2010 7:39 pm

Doing an input test, would like the iOS device to vibrate on error.

The beep sounds like normal input.

How can I get the iOS device to vibrate?


VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Location: Fredericktown, MO

Re: Vibrate Error Message

Post by ctflatt » Tue Nov 16, 2010 1:40 am


I'm not sure that the device-specific vibrate feature is supported in the pre-release.

Posts: 31
Joined: Thu Feb 11, 2010 5:47 pm

Re: Vibrate Error Message

Post by RickD » Wed Dec 01, 2010 1:13 am


This is directly from the ios_prerelease_handbook.pdf...

System alert support
Support has been added for the beepSound and beep commands. These hook into iPhoneOS's
standard PlayPlayerSound support.

To specify a sound to be played as the system sound, use the beepSound global property. This
should be set to the filename of the sound to use when beep is executed. If you want no sound to
play when using beep, simply set the beepSound to empty.

To perform a system alert, use the beep command. If no sound has been specified via the
beepSound global property, the engine will request a vibration alert.

Note: The iPhone has no default system alert sound so if a sound is required one must be specified
by using the beepSound. The action of beep is controlled by the system and depends on the user's
preference settings. In particular, a beep will only cause a vibration if the user has enabled that
feature. Similarly, a beep will only cause a sound if the phone is not in silent mode.

I use the beep command with the beepSound property set to empty and my iPhone vibrates.
The code would look like this:

if (your error condition) then beep

Hope this helps!

Post Reply

Return to “iOS Deployment”