### Start Example App Packager Source: https://github.com/codingbyjerez/react-native-alert-notification/blob/master/CONTRIBUTING.md Starts the Metro server for the example application. This allows for hot-reloading of JavaScript changes in the example app without a rebuild. ```sh yarn example start ``` -------------------------------- ### Run Example App on Web Source: https://github.com/codingbyjerez/react-native-alert-notification/blob/master/CONTRIBUTING.md Builds and runs the example application in a web browser. This allows for testing on a web platform. ```sh yarn example web ``` -------------------------------- ### Bootstrap Project Dependencies Source: https://github.com/codingbyjerez/react-native-alert-notification/blob/master/CONTRIBUTING.md Installs all project dependencies and initializes native dependencies (e.g., pods for iOS). This is a comprehensive setup script. ```sh yarn bootstrap ``` -------------------------------- ### Install react-native-alert-notification and Dependencies Source: https://context7.com/codingbyjerez/react-native-alert-notification/llms.txt Instructions to install the react-native-alert-notification library and its dependencies, react-native-safe-area-context. Includes commands for both native and Expo projects. ```bash # Install the library yarn add react-native-alert-notification # For Native projects - install dependencies yarn add react-native-safe-area-context cd ios && pod install # For Expo projects - install dependencies expo install react-native-safe-area-context ``` -------------------------------- ### Run Example App on Android Source: https://github.com/codingbyjerez/react-native-alert-notification/blob/master/CONTRIBUTING.md Builds and runs the example application on an Android device or emulator. Requires a properly configured Android development environment. ```sh yarn example android ``` -------------------------------- ### Run Example App on iOS Source: https://github.com/codingbyjerez/react-native-alert-notification/blob/master/CONTRIBUTING.md Builds and runs the example application on an iOS device or simulator. Requires a properly configured iOS development environment (Xcode). ```sh yarn example ios ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/codingbyjerez/react-native-alert-notification/blob/master/CONTRIBUTING.md Installs all the necessary dependencies for the project using Yarn. It's recommended to use Yarn over npm for development as the tooling is built around it. ```sh yarn ``` -------------------------------- ### Install Dependencies for Expo Projects Source: https://github.com/codingbyjerez/react-native-alert-notification/blob/master/README.md Installs the react-native-safe-area-context dependency specifically for Expo managed projects. ```sh expo install react-native-safe-area-context ``` -------------------------------- ### Install Dependencies for Native Projects Source: https://github.com/codingbyjerez/react-native-alert-notification/blob/master/README.md Installs necessary dependencies for native React Native projects, including react-native-safe-area-context and its native pods. ```sh yarn add react-native-safe-area-context pod install ``` -------------------------------- ### Install react-native-alert-notification Source: https://github.com/codingbyjerez/react-native-alert-notification/blob/master/README.md Installs the react-native-alert-notification package using Yarn. This is the primary dependency for using the library's features. ```sh yarn add react-native-alert-notification ``` -------------------------------- ### React Native Alert Notification Integration Example Source: https://context7.com/codingbyjerez/react-native-alert-notification/llms.txt This React Native component demonstrates the usage of the react-native-alert-notification library to display various types of notifications. It includes handling form submissions with loading states, API call success and error feedback, and user confirmation dialogs for destructive actions. The example utilizes `Dialog` and `Toast` components with different `ALERT_TYPE` configurations. ```tsx import React, { useState } from 'react'; import { View, Button, StyleSheet } from 'react-native'; import { AlertNotificationRoot, Dialog, Toast, ALERT_TYPE } from 'react-native-alert-notification'; const App = () => { const [loading, setLoading] = useState(false); const handleSaveData = async () => { // Show loading dialog Dialog.show({ type: ALERT_TYPE.INFO, title: 'Saving', textBody: 'Please wait while we save your data...', closeOnOverlayTap: false }); setLoading(true); try { // Simulate API call await new Promise((resolve) => setTimeout(resolve, 2000)); Dialog.hide(); // Close loading dialog // Show success toast Toast.show({ type: ALERT_TYPE.SUCCESS, title: 'Success', textBody: 'Your data has been saved successfully', autoClose: 3000 }); } catch (error) { Dialog.hide(); // Close loading dialog // Show error dialog Dialog.show({ type: ALERT_TYPE.DANGER, title: 'Error', textBody: 'Failed to save data. Please try again.', button: 'Retry', onPressButton: () => { Dialog.hide(); handleSaveData(); } }); } finally { setLoading(false); } }; const handleDeleteAccount = () => { Dialog.show({ type: ALERT_TYPE.WARNING, title: 'Confirm Deletion', textBody: 'This action cannot be undone. Are you sure?', button: 'Delete', closeOnOverlayTap: true, onPressButton: () => { Dialog.hide(); Toast.show({ type: ALERT_TYPE.INFO, title: 'Deleted', textBody: 'Your account has been deleted', autoClose: 5000 }); } }); }; return (