showActionSheetWithOptions()
static showActionSheetWithOptions(options, callback)
Display an iOS action sheet. The options
object must contain one or more of:
options
(array of strings) - a list of button titles (required)cancelButtonIndex
(int) - index of cancel button in options
destructiveButtonIndex
(int) - index of destructive button in options
title
(string) - a title to show above the action sheetmessage
(string) - a message to show below the titletintColor
(string) - the color used for non-destructive button titlesThe 'callback' function takes one parameter, the zero-based index of the selected item.
Minimal example:
ActionSheetIOS.showActionSheetWithOptions({ options: ['Cancel', 'Remove'], destructiveButtonIndex: 1, cancelButtonIndex: 0, }, (buttonIndex) => { if (buttonIndex === 1) { /* destructive action */ } });
showShareActionSheetWithOptions()
static showShareActionSheetWithOptions(options, failureCallback, successCallback)
Display the iOS share sheet. The options
object should contain one or both of message
and url
and can additionally have a subject
or excludedActivityTypes
:
url
(string) - a URL to sharemessage
(string) - a message to sharesubject
(string) - a subject for the messageexcludedActivityTypes
(array) - the activities to exclude from the ActionSheetNOTE: if url
points to a local file, or is a base64-encoded uri, the file it points to will be loaded and shared directly. In this way, you can share images, videos, PDF files, etc.
The 'failureCallback' function takes one parameter, an error object. The only property defined on this object is an optional stack
property of type string
.
The 'successCallback' function takes two parameters:
© 2015–2018 Facebook Inc.
Licensed under the Creative Commons Attribution 4.0 International Public License.
https://facebook.github.io/react-native/docs/actionsheetios.html