Overview
Native alerts display critical information that a user needs immediately. You can learn more about native alerts and native action sheets (a type of alerts) from Apple's guidelines.
There are twos types of native alerts in Play— Action Sheet and Alerts—each can provide the same options, but their layout and use cases are different.
Alerts are pop-ups above the UI that alert users to urgent information. For example, when navigating on a map, users might see an alert if there is a new, upcoming crash that impacts their route.
Action Sheets open a modal style alert that provides users options based on their initial action. For example, when deleting an email, users might see an action sheet that allows them to delete the email or cancel the interaction.
First: Add an Alert Trigger
The first step in creating a native alert is to add an Alert trigger to an object or page.
Note: it doesn't matter where you place an Alert trigger, because alerts are shown using Show Alert actions.
Set the title and message, and choose between alert and action sheet for the preferred style.
Add Alert Items
To create an alert, add alert items by adding a different Alert Action for each item. Play will handle the rest natively. By default, we add two Alert Actions, but you can add or remove to achieve your desired number of actions.
Adding Actions to Alert Actions
To trigger other actions when the alert items are tapped, you can add actions to the Alert Actions. You can add any number of actions, including conditions, loops, etc.
Add Input Text Field Actions
Sometimes native alerts require information from the user to complete actions. In these scenarios, you can add an input text field to a native menu using a Alert Text Field action.
Display the Alert
Your native menu won't display just by adding the Action trigger to your project. You need to trigger a Show Alert action, targeting that Action trigger.
Resources
Learn more about each trigger or action from our documentation articles: