PhoneGap - Notifications

Description

Display or initiate a native notification (for example, beep, native alert/prompt/confirmation, vibrate, etc.)

Used with the UX component.

 Display Or Initiate A Native PhoneGap Notification Properties

Notification Type

Displays a native alert, confirmation or prompt dialog, or initiates an audio beep or causes the mobile device to vibrate. Choices include Alert, Confirm, Prompt, Beep, Vibrate.

Dialog Title

Optional, set the title of the pop up dialog. If left blank the default value is used Default values are Alert, Confirm or Prompt dependent upon the selected notification type.

Dialog Message

Specify the message. The message text must be in the form of a Javascript expression, or it may reference a JavaScript variable which means that text must be enclosed in single quotes. For example: 'You are now logged on' This example shows a message that contains a variable: 'Your user name is:' + userName. You can call a Javascript function to define the message text. For example, specify this as the message text: myJsFunction()

Default Value

Enter the default textbox input value (string), this is optional. The default text must be in the form of a Javascript expression, or it may reference a JavaScript variable which means that text must be enclosed in single quotes. For example: 'Anonymous User'. You can call a Javascript function to define the message text. For example, specify the default value: setDefaultValue(). You can also simply reference a predefined JavaScript variable, for example _thisUser.

JavaScript Callback Function Name

Enter the JavaScript callback function name that will be used to process the button selection(s) and the prompt input result if applicable.

Button Label

Text to display within the button. The default value is 'OK'.

Button Labels

Enter a character string of values separated by commas. You are entering a one based index array so element 1 is referenced in the callback as result.buttonIndex(1).

Beep Count

Set the number of times a beep will sound on the device. This value is ignored on iOS devices

Time Duration

Sets the period of time (in milliseconds)for the device to vibrate. This value is ignored on iOS devices.

See Also