The device will play a beep sound.

  • times: The number of times to repeat the beep (Number)

Supported Platforms

  • Android
  • BlackBerry WebWorks (OS 5.0 and higher)
  • iPhone
  • Windows Phone 7 ( Mango )

Quick Example

// Beep twice!

Full Example

<!DOCTYPE html>
    <title>Notification Example</title>

    <script type="text/javascript" charset="utf-8" src="cordova-1.6.0.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for Cordova to load
    document.addEventListener("deviceready", onDeviceReady, false);

    // Cordova is ready
    function onDeviceReady() {
        // Empty

    // Show a custom alert
    function showAlert() {
	        'You are the winner!',  // message
	        'Game Over',            // title
	        'Done'                  // buttonName

    // Beep three times
    function playBeep() {

    // Vibrate for 2 seconds
    function vibrate() {

    <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>
    <p><a href="#" onclick="playBeep(); return false;">Play Beep</a></p>
    <p><a href="#" onclick="vibrate(); return false;">Vibrate</a></p>

Android Quirks

  • Android plays the default "Notification ringtone" specified under the "Settings/Sound & Display" panel.

iPhone Quirks

  • Ignores the beep count argument.
  • There is no native beep API for iPhone.
    • Cordova implements beep by playing an audio file via the media API.
    • The user must provide a file with the desired beep tone.
    • This file must be less than 30 seconds long, located in the www/ root, and must be named beep.wav.

Windows Phone 7 Quirks

  • WP7 Cordova lib includes a generic beep file that is used.