You are viewing the Resources for the older version of JourneyApps (V3). JourneyApps V4 is the new default for all new apps since July 1, 2016.

Dialogs

JourneyApps supports displaying alert and confirmation dialogs to the user. Dialogs need to be triggered from JavaScript.

Please Note: Dialog functionality has changed significantly since version 3.10.0 of the JourneyApps Container on Android. Prior to version 3.10.0, JourneyApps only supported alert dialogs with a heading and a message, for example dialog("This is the title", "This is the message"), and only one dialog could be displayed from a JavaScript function that is called when a button was pressed (the dialog had to be "returned" by the function: return dialog("Title", "This is the message")).

Most of the dialog functionality shown below is only available since version 3.10.0 of the JourneyApps Container on Android — If you experience issues while trying to use dialogs, please check that you're running 3.10.0 of the JourneyApps Android app or newer. iOS users are not affected — all the dialog functionality below will be available if you're using JourneyApps on iOS.

Alert Dialogs

To display an alert dialog to the user, use the dialog() built-in JourneyApps function in your JavaScript.

Simplest Alert Dialog

If you provide one argument to dialog(), a dialog will be shown with simply a message:

Alert Dialog with a Title

To display a dialog with a title and message, provide two arguments to dialog(). The first parameter is the title, the second is the message:

Confirmation Dialogs

To display an confirmation dialog to the user, use the confirmDialog() built-in JourneyApps function in your JavaScript.

Simplest Confirm Dialog

The simplest case of using confirmDialog() is simply to provide the message shown in the dialog, and the return value of confirmDialog() indicates whether the user pressed "OK" or "Cancel":

Confirm Dialog with a Title

To display a dialog with a title and message, provide two arguments to confirmDialog(). The first parameter is the title, the second is the message. The return value of confirmDialog() indicates whether the user pressed "OK" or "Cancel":

Customizing the Button Text

The default "OK" and "Cancel" buttons can be customized by providing two additional arguments to confirmDialog():