From c602ad17a7a19d288ae5b15b3cf6475e7279fdf0 Mon Sep 17 00:00:00 2001
From: Travis CI
This is an API that works both on iOS and Android and can show static
alerts. To show an alert that prompts the user to enter some information,
see AlertIOS; entering text in an alert is common on iOS only.
On iOS you can specify any number of buttons. Each button can optionally
-specify a style and you can also specify type of the alert. Refer to
-AlertIOS for details.
On Android at most three buttons can be specified. Android has a concept +specify a style, which is one of 'default', 'cancel' or 'destructive'.
On Android at most three buttons can be specified. Android has a concept of a neutral, negative and a positive button:
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.
Use this API for iOS-specific features, such as prompting the user to enter
-some information. In other cases, especially to show static alerts, use
-the cross-platform Alert API.
The AlertsIOS utility provides two functions: alert and prompt. All
+functionality available through AlertIOS.alert is also available in the
+cross-platform Alert.alert, which we recommend you use if you don't need
+iOS-specific functionality.
AlertIOS.prompt allows you to prompt the user for input inside of an
+alert popup.
Creates a popup to alert the user. See +Alert.
callbackOrButtons -- This optional argument should be either a +single-argument function or an array of buttons. If passed a function, +it will be called when the user taps 'OK'.
If passed an array of button configurations, each button should include
+a text key, as well as optional onPress and style keys.
+style should be one of 'default', 'cancel' or 'destructive'.
Example:
Prompt the user to enter some text.
callbackOrButtons -- This optional argument should be either a +single-argument function or an array of buttons. If passed a function, +it will be called with the prompt's value when the user taps 'OK'.
If passed an array of button configurations, each button should include
+a text key, as well as optional onPress and style keys (see example).
+style should be one of 'default', 'cancel' or 'destructive'.
Example with custom buttons:
Prompt the user to enter some text.
Example with the default button and a custom callback: