Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,361 changes: 1,361 additions & 0 deletions design/Illustrations/illustrations_security.ai

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3422,6 +3422,21 @@
"version-0.60/version-0.60-virtualizedlist": {
"title": "VirtualizedList"
},
"version-0.61/version-0.61-alertios": {
"title": "🚧 AlertIOS"
},
"version-0.61/version-0.61-asyncstorage": {
"title": "🚧 AsyncStorage"
},
"version-0.61/version-0.61-clipboard": {
"title": "🚧 Clipboard"
},
"version-0.61/version-0.61-datepickerandroid": {
"title": "🚧 DatePickerAndroid"
},
"version-0.61/version-0.61-datepickerios": {
"title": "🚧 DatePickerIOS"
},
"version-0.61/version-0.61-debugging": {
"title": "Debugging"
},
Expand All @@ -3434,12 +3449,45 @@
"version-0.61/version-0.61-getting-started": {
"title": "Getting Started"
},
"version-0.61/version-0.61-imageeditor": {
"title": "🚧 ImageEditor"
},
"version-0.61/version-0.61-imagepickerios": {
"title": "🚧 ImagePickerIOS"
},
"version-0.61/version-0.61-pickerios": {
"title": "🚧 PickerIOS"
},
"version-0.61/version-0.61-progressbarandroid": {
"title": "🚧 ProgressBarAndroid"
},
"version-0.61/version-0.61-progressviewios": {
"title": "🚧 ProgressViewIOS"
},
"version-0.61/version-0.61-pushnotificationios": {
"title": "🚧 PushNotificationIOS"
},
"version-0.61/version-0.61-segmentedcontrolios": {
"title": "🚧 SegmentedControlIOS"
},
"version-0.61/version-0.61-slider": {
"title": "🚧 Slider"
},
"version-0.61/version-0.61-statusbarios": {
"title": "🚧 StatusBarIOS"
},
"version-0.61/version-0.61-timepickerandroid": {
"title": "🚧 TimePickerAndroid"
},
"version-0.61/version-0.61-typescript": {
"title": "Using TypeScript with React Native"
},
"version-0.61/version-0.61-usewindowdimensions": {
"title": "useWindowDimensions"
},
"version-0.61/version-0.61-viewpagerandroid": {
"title": "🚧 ViewPagerAndroid"
},
"version-0.7/version-0.7-pushnotificationios": {
"title": "PushNotificationIOS"
},
Expand Down
39 changes: 4 additions & 35 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"safeareaview",
"scrollview",
"sectionlist",
"slider",
"statusbar",
"switch",
"text",
Expand All @@ -89,26 +88,12 @@
{
"type": "subcategory",
"label": "Android Components",
"ids": [
"drawerlayoutandroid",
"progressbarandroid",
"touchablenativefeedback",
"viewpagerandroid"
]
"ids": ["drawerlayoutandroid", "touchablenativefeedback"]
},
{
"type": "subcategory",
"label": "iOS Components",
"ids": [
"datepickerios",
"inputaccessoryview",
"maskedviewios",
"pickerios",
"progressviewios",
"segmentedcontrolios",
"tabbarios",
"tabbarios-item"
]
"ids": ["inputaccessoryview", "maskedviewios"]
}
],
"Props": [
Expand All @@ -125,12 +110,9 @@
"appearance",
"appregistry",
"appstate",
"asyncstorage",
"clipboard",
"devsettings",
"dimensions",
"easing",
"imageeditor",
"interactionmanager",
"keyboard",
"layoutanimation",
Expand All @@ -150,25 +132,12 @@
{
"type": "subcategory",
"label": "Android APIs",
"ids": [
"backhandler",
"datepickerandroid",
"permissionsandroid",
"timepickerandroid",
"toastandroid"
]
"ids": ["backhandler", "permissionsandroid", "toastandroid"]
},
{
"type": "subcategory",
"label": "iOS APIs",
"ids": [
"actionsheetios",
"alertios",
"imagepickerios",
"pushnotificationios",
"settings",
"statusbarios"
]
"ids": ["actionsheetios", "settings"]
}
]
}
Expand Down
187 changes: 187 additions & 0 deletions website/versioned_docs/version-0.61/alertios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
---
id: version-0.61-alertios
title: 🚧 AlertIOS
original_id: alertios
---

> **Deprecated.** Use [`Alert`](alert) instead.

`AlertIOS` provides functionality to create an iOS alert dialog with a message or create a prompt for user input.

Creating an iOS alert:

```jsx
AlertIOS.alert('Sync Complete', 'All your data are belong to us.');
```

Creating an iOS prompt:

```jsx
AlertIOS.prompt('Enter a value', null, (text) =>
console.log('You entered ' + text),
);
```

We recommend using the [`Alert.alert`](alert.md) method for cross-platform support if you don't need to create iOS-only prompts.

---

# Reference

## Methods

### `alert()`

```jsx
static alert(title: string, [message]: string, [callbackOrButtons]: ?(() => void), ButtonsArray, [type]: AlertType): [object Object]
```

Create and display a popup alert.

**Parameters:**

| Name | Type | Required | Description |
| ----------------- | ------------------------------------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| title | string | Yes | The dialog's title. Passing null or '' will hide the title. |
| message | string | No | An optional message that appears below the dialog's title. |
| callbackOrButtons | ?(() => void),[ButtonsArray](alertios.md#buttonsarray) | No | 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'. |
| type | [AlertType](alertios.md#alerttype) | No | Deprecated, do not use. |

Example with custom buttons:

```jsx
AlertIOS.alert(
'Update available',
'Keep your app up to date to enjoy the latest features',
[
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel',
},
{
text: 'Install',
onPress: () => console.log('Install Pressed'),
},
],
);
```

---

### `prompt()`

```jsx
static prompt(title: string, [message]: string, [callbackOrButtons]: ?((text: string) => void), ButtonsArray, [type]: AlertType, [defaultValue]: string, [keyboardType]: string): [object Object]
```

Create and display a prompt to enter some text.

**Parameters:**

| Name | Type | Required | Description |
| ----------------- | ------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| title | string | Yes | The dialog's title. |
| message | string | No | An optional message that appears above the text input. |
| callbackOrButtons | ?((text: string) => void),[ButtonsArray](alertios.md#buttonsarray) | No | 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'. |
| type | [AlertType](alertios.md#alerttype) | No | This configures the text input. One of 'plain-text', 'secure-text' or 'login-password'. |
| defaultValue | string | No | The default text in text input. |
| keyboardType | string | No | The keyboard type of first text field(if exists). One of 'default', 'email-address', 'numeric', 'phone-pad', 'ascii-capable', 'numbers-and-punctuation', 'url', 'number-pad', 'name-phone-pad', 'decimal-pad', 'twitter' or 'web-search'. |

Example with custom buttons:

```jsx
AlertIOS.prompt(
'Enter password',
'Enter your password to claim your $1.5B in lottery winnings',
[
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel',
},
{
text: 'OK',
onPress: (password) => console.log('OK Pressed, password: ' + password),
},
],
'secure-text',
);
```

,

Example with the default button and a custom callback:

```jsx
AlertIOS.prompt(
'Update username',
null,
(text) => console.log('Your username is ' + text),
null,
'default',
);
```

## Type Definitions

### AlertType

An Alert button type

| Type |
| ------ |
| \$Enum |

**Constants:**

| Value | Description |
| -------------- | ---------------------------- |
| default | Default alert with no inputs |
| plain-text | Plain text input alert |
| secure-text | Secure text input alert |
| login-password | Login and password alert |

---

### AlertButtonStyle

An Alert button style

| Type |
| ------ |
| \$Enum |

**Constants:**

| Value | Description |
| ----------- | ------------------------ |
| default | Default button style |
| cancel | Cancel button style |
| destructive | Destructive button style |

---

### ButtonsArray

Array or buttons

| Type |
| ----- |
| Array |

**Properties:**

| Name | Type | Description |
| --------- | ------------------------------------------------ | ------------------------------------- |
| [text] | string | Button label |
| [onPress] | function | Callback function when button pressed |
| [style] | [AlertButtonStyle](alertios.md#alertbuttonstyle) | Button style |

**Constants:**

| Value | Description |
| ------- | ------------------------------------- |
| text | Button label |
| onPress | Callback function when button pressed |
| style | Button style |
Loading