O'Reilly logo

iPhone JavaScript Cookbook by Arturo Fernandez Montoro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making a vibrate alert

In the previous recipe, you've learned how to create a simple notification using a beep sound. Continuing with notifications, we're going to find out how to vibrate our device with JavaScript.

This recipe is very similar to the previous one. In fact, we'll only need to change one line of JavaScript code for testing our new kind of notification.

You can find the complete code for this recipe at: code/ch05/vibrate/ in the code bundle provided on the Packtpub site.

Getting ready

As we've seen in the previous recipe, we'll need the PhoneGap and UiUIKit frameworks plus the Xcode IDE. Remember that this IDE requires a Mac OS X operating system installed on your computer. Also, it's important to keep in mind that you need to be a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required