Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Notification

This plugin provides access to some native dialog UI elements.

Hierarchy

  • Notification

Index

Methods

alert

  • alert(message: string, alertCallback: function, title?: string, buttonName?: string): void
  • Shows a custom alert or dialog box. Most Cordova implementations use a native dialog box for this feature, but some platforms use the browser's alert function, which is typically less customizable.

    Parameters

    • message: string

      Dialog message.

    • alertCallback: function

      Callback to invoke when alert dialog is dismissed.

        • (): void
        • Returns void

    • Optional title: string

      Dialog title, defaults to 'Alert'.

    • Optional buttonName: string

      Button name, defaults to OK.

    Returns void

beep

  • beep(times: number): void
  • The device plays a beep sound.

    Parameters

    • times: number

      The number of times to repeat the beep.

    Returns void

confirm

  • confirm(message: string, confirmCallback: function, title?: string, buttonLabels?: string[]): void
  • Displays a customizable confirmation dialog box.

    Parameters

    • message: string

      Dialog message.

    • confirmCallback: function

      Callback to invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0).

        • (choice: number): void
        • Parameters

          • choice: number

          Returns void

    • Optional title: string

      Dialog title, defaults to Confirm.

    • Optional buttonLabels: string[]

      Array of strings specifying button labels, defaults to [OK,Cancel].

    Returns void

prompt

  • prompt(message: string, promptCallback: function, title?: string, buttonLabels?: string[], defaultText?: string): void
  • Displays a native dialog box that is more customizable than the browser's prompt function.

    Parameters

    • message: string

      Dialog message.

    • promptCallback: function

      Callback to invoke when a button is pressed.

    • Optional title: string

      Dialog title, defaults to "Prompt".

    • Optional buttonLabels: string[]

      Array of strings specifying button labels, defaults to ["OK","Cancel"].

    • Optional defaultText: string

      Default textbox input value, default: "".

    Returns void