### Run Example Application Source: https://github.com/gabriel-sisjr/react-native-background-location/blob/develop/example/README.md Commands to install dependencies and launch the example app on an Android device or emulator. ```bash # Install dependencies yarn # Start Metro bundler yarn example start # Run on Android device/emulator yarn example android ``` -------------------------------- ### Install Pods and Run iOS Example Source: https://github.com/gabriel-sisjr/react-native-background-location/blob/develop/website/docs/development/contributing.md Installs iOS dependencies using CocoaPods and then runs the example application. This is necessary after modifying native iOS code. ```sh cd example/ios && pod install && cd ../.. yarn example ios ``` -------------------------------- ### Start Example App Metro Bundler Source: https://github.com/gabriel-sisjr/react-native-background-location/blob/develop/website/docs/development/contributing.md Starts the Metro bundler for the example application. This allows for live reloading of JavaScript changes. ```sh yarn example start ``` -------------------------------- ### Geofencing Quick Start Source: https://github.com/gabriel-sisjr/react-native-background-location/blob/develop/website/docs/guides/geofencing.md A minimal example demonstrating how to register a geofence and listen for transition events. ```APIDOC ## Geofencing Quick Start ### Description This example shows how to initialize geofencing, add a geofence, and react to transition events. ### Method N/A (Component Example) ### Endpoint N/A ### Parameters N/A ### Request Example ```typescript import React, { useState } from 'react'; import { View, Text, Button } from 'react-native'; import { useGeofencing, useGeofenceEvents, GeofenceTransitionType, } from '@gabriel-sisjr/react-native-background-location'; function GeofenceDemo() { const [enterCount, setEnterCount] = useState(0); const { geofences, addGeofence, maxGeofences } = useGeofencing(); useGeofenceEvents({ onTransition: (event) => { if (event.transitionType === GeofenceTransitionType.ENTER) { setEnterCount((prev) => prev + 1); } }, }); const handleAddGeofence = async () => { await addGeofence({ identifier: 'office', latitude: -23.5505, longitude: -46.6333, radius: 200, }); }; return ( Active: {geofences.length} / {maxGeofences} Enter events: {enterCount}