Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
Launches an alert dialog with the specified title and message. Optionally provide a list of buttons. Tapping any button will fire the respective onPress callback and dismiss the alert. By default, the only button will be an ‘OK’ button.

Example

iOS

On iOS you can specify any number of buttons. Each button can optionally specify a style or be emphasized, available options are represented by the AlertButtonStyle enum and the isPreferred field on AlertButton.

Android

On Android at most three buttons can be specified. Android has a concept of a neutral, negative and a positive button:
  • If you specify one button, it will be the ‘positive’ one (such as ‘OK’)
  • Two buttons mean ‘negative’, ‘positive’ (such as ‘Cancel’, ‘OK’)
  • Three buttons mean ‘neutral’, ‘negative’, ‘positive’ (such as ‘Later’, ‘Cancel’, ‘OK’)
Alerts on Android can be dismissed by tapping outside of the alert box. It is disabled by default and can be enabled by providing an optional AlertOptions parameter with the cancelable property set to true i.e.
{cancelable: true}.
The cancel event can be handled by providing an onDismiss callback property inside the options parameter.

Vega

Vega mimics the behaviour of Android’s alert with at most three buttons and its positive/negative/neutral semantics.
  • If you specify one button, it will be the ‘positive’ one (such as ‘OK’)
  • Two buttons mean ‘negative’, ‘positive’ (such as ‘Cancel’, ‘OK’)
  • Three buttons mean ‘neutral’, ‘negative’, ‘positive’ (such as ‘Later’, ‘Cancel’, ‘OK’)
The alert may be dismissed by providing an optional AlertOptions parameter with the cancelable property set to true i.e. {cancelable: true}. The cancel event can be handled by providing an onDismiss callback property inside the options parameter.

Example Android


Reference

Methods

alert()

Parameters:

prompt() iOS

Create and display a prompt to enter some text in form of Alert. Parameters:

Type Definitions

AlertButtonStyle iOS Vega Not Available

An iOS Alert button style. Constants:

AlertType iOS Vega Not Available

An iOS Alert type. Constants:

AlertButton

An object describing the configuration of a button in the alert. Objects properties:

AlertOptions

Properties:
Last modified on May 13, 2026