{"_id":"@amrshbib/react-native-geolocation","_rev":"12-da3b21b5affddcbe677675434d4d5de3","name":"@amrshbib/react-native-geolocation","dist-tags":{"latest":"2.0.1"},"versions":{"0.0.4":{"name":"@amrshbib/react-native-geolocation","version":"0.0.4","keywords":["react-native","geolocation","location","android","ios","kotlin","swift","gps","fusedlocationprovider","permissions","typescript"],"author":{"name":"Amr Shbib"},"license":"MIT","_id":"@amrshbib/react-native-geolocation@0.0.4","maintainers":[{"name":"amrshbib","email":"amr.shbib@gmail.com"}],"dist":{"shasum":"42d9fca182cdd1787a6736e3fd7f42318cbabdb8","tarball":"https://registry.npmjs.org/@amrshbib/react-native-geolocation/-/react-native-geolocation-0.0.4.tgz","fileCount":1654,"integrity":"sha512-NUTHuZTyaX5qzDXWGLDG/b/9cSEALukU4Y419PRwRiHr88vzAMWQGSopqt9WIEaJTK239+EpADeV4FQrWD66wg==","signatures":[{"sig":"MEUCIQDpoZE3T0LFbok/nPm8HNiGtyrA15uosh6EpVTB9cRQgAIgQhOg6XAc1JuudH/0kzifDifFavThMA8l1JFYzsK39+o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8001382},"main":"index.js","rnpm":{"android":{"sourceDir":"./android","packageInstance":"new GeolocationPackage()","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;"}},"types":"./index.d.ts","gitHead":"cecaa4aad7c547b0753f59ab1bf7df5308cc1454","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"echo 'Build completed'","publish":"npm publish --access public","prepublishOnly":"npm run build"},"_npmUser":{"name":"amrshbib","email":"amr.shbib@gmail.com"},"_npmVersion":"11.4.2","description":"React Native geolocation package with FusedLocationProviderClient for high accuracy location tracking","directories":{},"_nodeVersion":"24.4.1","react-native":{"ios":{"podspecPath":"./AmrShbib-Geolocation.podspec"},"android":{"sourceDir":"./android","packageInstance":"new GeolocationPackage()","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;"}},"_hasShrinkwrap":false,"peerDependencies":{"react-native":">=0.60.0"},"_npmOperationalInternal":{"tmp":"tmp/react-native-geolocation_0.0.4_1758466935090_0.28182598475959875","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@amrshbib/react-native-geolocation","version":"0.0.5","keywords":["react-native","geolocation","location","android","ios","kotlin","swift","gps","fusedlocationprovider","permissions","typescript"],"author":{"name":"Amr Shbib"},"license":"MIT","_id":"@amrshbib/react-native-geolocation@0.0.5","maintainers":[{"name":"amrshbib","email":"amr.shbib@gmail.com"}],"dist":{"shasum":"d7cd74d1430d950dfd7142db705ddb8c5ce969e2","tarball":"https://registry.npmjs.org/@amrshbib/react-native-geolocation/-/react-native-geolocation-0.0.5.tgz","fileCount":1654,"integrity":"sha512-XrW6QWVOV3NN2tVhhdJ863EfDbUOXELmW+QPy/vHjIDhgBwZvJPY7PaDaNeCKVQBRhn9zIaWhfxlEcH8mgY55A==","signatures":[{"sig":"MEQCICAB0ioQ4D+cOvyOqTHx07QZ6lSyqF2gWDKo8sOYM17aAiBslXZIbTAS0q3Lj0spAxeas7UqQLP9J4ST1qel1qdu/g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8001382},"main":"index.js","rnpm":{"android":{"sourceDir":"./android","packageInstance":"new GeolocationPackage()","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;"}},"types":"./index.d.ts","gitHead":"cecaa4aad7c547b0753f59ab1bf7df5308cc1454","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"echo 'Build completed'","publish":"npm publish --access public","prepublishOnly":"npm run build"},"_npmUser":{"name":"amrshbib","email":"amr.shbib@gmail.com"},"_npmVersion":"11.4.2","description":"React Native geolocation package with FusedLocationProviderClient for high accuracy location tracking","directories":{},"_nodeVersion":"24.4.1","react-native":{"ios":{"podspecPath":"./AmrShbib-Geolocation.podspec"},"android":{"sourceDir":"./android","packageInstance":"new GeolocationPackage()","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;"}},"_hasShrinkwrap":false,"peerDependencies":{"react-native":">=0.60.0"},"_npmOperationalInternal":{"tmp":"tmp/react-native-geolocation_0.0.5_1758466949403_0.6232770056447006","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@amrshbib/react-native-geolocation","version":"0.1.0","keywords":["react-native","geolocation","location","android","ios","kotlin","swift","gps","fusedlocationprovider","permissions","typescript"],"author":{"name":"Amr Shbib"},"license":"MIT","_id":"@amrshbib/react-native-geolocation@0.1.0","maintainers":[{"name":"amrshbib","email":"amr.shbib@gmail.com"}],"dist":{"shasum":"5bd13d2538bc7b83986ed4e650bdeadcf8189762","tarball":"https://registry.npmjs.org/@amrshbib/react-native-geolocation/-/react-native-geolocation-0.1.0.tgz","fileCount":1654,"integrity":"sha512-qLu6elyPhjfJ1UvqIv/bUvW4YRLHcOlvD/4oUIWYhCJB5IY3ZjT0zq7qWAqbzPVk0l+DfDas1lyj01bTD47SgA==","signatures":[{"sig":"MEUCIATUD1+yBm6ze6gBth8GBmTxLJz+mBwc4Nwjjoum6ZOUAiEA5CD00IMThF3ex/wpmzUUTsmzR56c7B7EvGjdzGL4HKU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8001382},"main":"index.js","rnpm":{"android":{"sourceDir":"./android","packageInstance":"new GeolocationPackage()","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;"}},"types":"./index.d.ts","gitHead":"cecaa4aad7c547b0753f59ab1bf7df5308cc1454","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"echo 'Build completed'","publish":"npm publish --access public","prepublishOnly":"npm run build"},"_npmUser":{"name":"amrshbib","email":"amr.shbib@gmail.com"},"_npmVersion":"11.4.2","description":"React Native geolocation package with FusedLocationProviderClient for high accuracy location tracking","directories":{},"_nodeVersion":"24.4.1","react-native":{"ios":{"podspecPath":"./AmrShbib-Geolocation.podspec"},"android":{"sourceDir":"./android","packageInstance":"new GeolocationPackage()","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;"}},"_hasShrinkwrap":false,"peerDependencies":{"react-native":">=0.60.0"},"_npmOperationalInternal":{"tmp":"tmp/react-native-geolocation_0.1.0_1758466965447_0.24301012003458533","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@amrshbib/react-native-geolocation","version":"1.0.0","keywords":["react-native","geolocation","location","android","ios","kotlin","swift","gps","fusedlocationprovider","permissions","typescript"],"author":{"name":"Amr Shbib"},"license":"MIT","_id":"@amrshbib/react-native-geolocation@1.0.0","maintainers":[{"name":"amrshbib","email":"amr.shbib@gmail.com"}],"dist":{"shasum":"f9d057e0b48cbecdd4c112bfab2b19786b1444f3","tarball":"https://registry.npmjs.org/@amrshbib/react-native-geolocation/-/react-native-geolocation-1.0.0.tgz","fileCount":1654,"integrity":"sha512-bWqCXoH4nzfmX8QlP2QUEOP0K8kXZ14XeCnuW67OQ3HyfeYShHm6OnSrOYEVDO9NtJPtMatz438LpO07lz+iDQ==","signatures":[{"sig":"MEQCIDi3C5JlksGpAp3VyPGXIzuimaTgpvH3zM5wvSWUkZ0QAiBpEw1CFw0vlwD6lt/vu7ka0H/z99cofDJGtSE+t3A17w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8001382},"main":"index.js","rnpm":{"android":{"sourceDir":"./android","packageInstance":"new GeolocationPackage()","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;"}},"types":"./index.d.ts","gitHead":"cecaa4aad7c547b0753f59ab1bf7df5308cc1454","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"echo 'Build completed'","publish":"npm publish --access public","prepublishOnly":"npm run build"},"_npmUser":{"name":"amrshbib","email":"amr.shbib@gmail.com"},"_npmVersion":"11.4.2","description":"React Native geolocation package with FusedLocationProviderClient for high accuracy location tracking","directories":{},"_nodeVersion":"24.4.1","react-native":{"ios":{"podspecPath":"./AmrShbib-Geolocation.podspec"},"android":{"sourceDir":"./android","packageInstance":"new GeolocationPackage()","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;"}},"_hasShrinkwrap":false,"peerDependencies":{"react-native":">=0.60.0"},"_npmOperationalInternal":{"tmp":"tmp/react-native-geolocation_1.0.0_1758466983882_0.9446575354043032","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@amrshbib/react-native-geolocation","version":"2.0.0","keywords":["react-native","geolocation","location","android","ios","kotlin","swift","gps","fusedlocationprovider","permissions","typescript"],"author":{"name":"Amr Shbib"},"license":"MIT","_id":"@amrshbib/react-native-geolocation@2.0.0","maintainers":[{"name":"amrshbib","email":"amr.shbib@gmail.com"}],"dist":{"shasum":"3a5205b3906ad65b645fb20e0b81159bbb19148d","tarball":"https://registry.npmjs.org/@amrshbib/react-native-geolocation/-/react-native-geolocation-2.0.0.tgz","fileCount":1654,"integrity":"sha512-gombPtLzJZ4NZWG/a0uaI8EaZV4OZ+yC0Xj1unXwiStSZuz66KoYeCYRIqIH43afO/s5V30mbe/RfnTOxGvNfg==","signatures":[{"sig":"MEQCIBRJHkmpl/qCBpUIBUHHe4QyTzZ9nkvV61RZfMsyTg3MAiA0CAcdJdg+p0qk92xyRb0FT7MrTwRoKYuTPTtjj/X9ww==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8001382},"main":"index.js","rnpm":{"android":{"sourceDir":"./android","packageInstance":"new GeolocationPackage()","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;"}},"types":"./index.d.ts","gitHead":"cecaa4aad7c547b0753f59ab1bf7df5308cc1454","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"echo 'Build completed'","publish":"npm publish --access public","prepublishOnly":"npm run build"},"_npmUser":{"name":"amrshbib","email":"amr.shbib@gmail.com"},"_npmVersion":"11.4.2","description":"React Native geolocation package with FusedLocationProviderClient for high accuracy location tracking","directories":{},"_nodeVersion":"24.4.1","react-native":{"ios":{"podspecPath":"./AmrShbib-Geolocation.podspec"},"android":{"sourceDir":"./android","packageInstance":"new GeolocationPackage()","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;"}},"_hasShrinkwrap":false,"peerDependencies":{"react-native":">=0.60.0"},"_npmOperationalInternal":{"tmp":"tmp/react-native-geolocation_2.0.0_1758467004075_0.9543754654234406","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@amrshbib/react-native-geolocation","version":"2.0.1","description":"React Native geolocation package with FusedLocationProviderClient for high accuracy location tracking","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","prepublishOnly":"npm run build","build":"echo 'Build completed'","publish":"npm publish --access public"},"keywords":["react-native","geolocation","location","android","ios","kotlin","swift","gps","fusedlocationprovider","permissions","typescript"],"author":{"name":"Amr Shbib"},"license":"MIT","peerDependencies":{"react-native":">=0.60.0"},"react-native":{"android":{"sourceDir":"./android","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;","packageInstance":"new GeolocationPackage()"},"ios":{"podspecPath":"./AmrShbib-Geolocation.podspec"}},"rnpm":{"android":{"sourceDir":"./android","packageImportPath":"import com.amrshbib.reactnativegeolocation.GeolocationPackage;","packageInstance":"new GeolocationPackage()"}},"_id":"@amrshbib/react-native-geolocation@2.0.1","gitHead":"203a91ce42e24d840073f7c36257d42b106d4aa5","types":"./index.d.ts","_nodeVersion":"24.4.1","_npmVersion":"11.4.2","dist":{"integrity":"sha512-s1jL66hmtuhdSXlmZypB0wsdIdRr003O18IwSzulm5X1g+/M6tal5Ho5Nyn/hFSynQWbBYJcNEstfN1xYzcmFw==","shasum":"89703ad422d0b52015b431492946d669059e8b04","tarball":"https://registry.npmjs.org/@amrshbib/react-native-geolocation/-/react-native-geolocation-2.0.1.tgz","fileCount":1671,"unpackedSize":8020637,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC/OdX/IA9z53XyG22zwQWNKQWH5HsqzUtwBQNpWRtsnAIgPnIX8DscXrBjVSrt34yD32sH0sBhIfuDqFDARgzK60E="}]},"_npmUser":{"name":"amrshbib","email":"amr.shbib@gmail.com"},"directories":{},"maintainers":[{"name":"amrshbib","email":"amr.shbib@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-geolocation_2.0.1_1762944746623_0.7691623729538728"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-21T15:02:15.013Z","modified":"2025-11-12T10:52:27.108Z","0.0.1":"2025-09-17T15:50:45.125Z","0.0.2":"2025-09-17T15:50:56.344Z","0.0.4":"2025-09-21T15:02:15.366Z","0.0.5":"2025-09-21T15:02:29.628Z","0.1.0":"2025-09-21T15:02:45.721Z","1.0.0":"2025-09-21T15:03:04.176Z","2.0.0":"2025-09-21T15:03:24.403Z","2025.9.21":"2025-09-21T15:03:43.311Z","2.0.1":"2025-11-12T10:52:26.877Z"},"author":{"name":"Amr Shbib"},"license":"MIT","keywords":["react-native","geolocation","location","android","ios","kotlin","swift","gps","fusedlocationprovider","permissions","typescript"],"description":"React Native geolocation package with FusedLocationProviderClient for high accuracy location tracking","maintainers":[{"name":"amrshbib","email":"amr.shbib@gmail.com"}],"readme":"# React Native Geolocation\n\n[![npm version](https://badge.fury.io/js/@amrshbib/react-native-geolocation.svg)](https://badge.fury.io/js/@amrshbib/react-native-geolocation)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![React Native](https://img.shields.io/badge/React%20Native-0.60%2B-blue.svg)](https://reactnative.dev/)\n\nA high-performance React Native geolocation library with advanced location tracking capabilities using Google's FusedLocationProviderClient for Android and CoreLocation for iOS.\n\n## ✨ Features\n\n- 🚀 **Cross-Platform**: Full support for both Android and iOS\n- 📍 **High Accuracy Location**: Uses Google's FusedLocationProviderClient on Android\n- 🔄 **Background Location**: Continuous location tracking in background\n- 🛡️ **Smart Permissions**: Automatic permission request dialogs with user guidance\n- 🎯 **Multiple Providers**: GPS, Network, Passive, and Bluetooth-based location\n- ⚡ **Real-time Watching**: Continuous location updates with configurable intervals\n- 📝 **TypeScript**: Complete TypeScript support with type definitions\n- 🔗 **Auto-linking**: Zero configuration setup for React Native 0.60+\n- 📱 **Easy API**: Simple getCurrentLocation/watchLocation methods\n- 🔧 **Permission Management**: Check and request permissions programmatically\n\n## 📦 Installation\n\n```bash\nnpm install @amrshbib/react-native-geolocation\n# or\nyarn add @amrshbib/react-native-geolocation\n```\n\n> **Note**: This package is currently in version 0.0.1 and ready for use. The package supports both Android and iOS platforms with comprehensive geolocation capabilities.\n\n### React Native 0.60+\n\nThis package supports auto-linking. No additional configuration is required.\n\n### React Native < 0.60\n\nFor older React Native versions, you'll need to manually link the package:\n\n```bash\nreact-native link @amrshbib/react-native-geolocation\n```\n\n## 🚀 Quick Start\n\n```javascript\nimport Geolocation from \"@amrshbib/react-native-geolocation\";\n\n// Get current location\nconst getCurrentLocation = async () => {\n  try {\n    const location = await Geolocation.getCurrentLocation({\n      enableHighAccuracy: true,\n      timeout: 15000,\n      priority: \"high_accuracy\",\n    });\n\n    console.log(\"Location:\", location);\n    // {\n    //   latitude: 37.7749,\n    //   longitude: -122.4194,\n    //   altitude: 10.5,\n    //   accuracy: 5.0,\n    //   heading: 45.0,\n    //   speed: 2.5,\n    //   timestamp: 1640995200000,\n    //   provider: \"gps\",\n    //   fromMockProvider: false,\n    //   coords: { ... }\n    // }\n  } catch (error) {\n    console.error(\"Error getting location:\", error);\n  }\n};\n\n// Watch location changes\nconst watchLocation = async () => {\n  try {\n    const watchId = await Geolocation.watchLocation(\n      (location, error) => {\n        if (error) {\n          console.error(\"Location error:\", error);\n        } else {\n          console.log(\"Location update:\", location);\n        }\n      },\n      {\n        enableHighAccuracy: true,\n        interval: 1000,\n        priority: \"high_accuracy\",\n      }\n    );\n\n    // Stop watching after 30 seconds\n    setTimeout(() => {\n      Geolocation.stopWatching(watchId);\n    }, 30000);\n  } catch (error) {\n    console.error(\"Error watching location:\", error);\n  }\n};\n\n// Check permissions\nconst checkPermissions = async () => {\n  const permissions = await Geolocation.checkPermissions();\n  console.log(\"Fine location:\", permissions.fine);\n  console.log(\"Background location:\", permissions.background);\n};\n\n// Request permissions\nconst requestPermissions = async () => {\n  const permissions = await Geolocation.requestPermissions();\n  if (permissions.fine) {\n    console.log(\"Location permission granted!\");\n  }\n};\n```\n\n## 📖 API Reference\n\n### `Geolocation.getCurrentLocation(options)`\n\nGet the current location once.\n\n**Parameters:**\n\n- `options` (Object, optional):\n  - `enableHighAccuracy` (boolean): Use high accuracy mode (default: true)\n  - `timeout` (number): Timeout in milliseconds (default: 15000)\n  - `maximumAge` (number): Maximum age of cached location in milliseconds (default: 10000)\n  - `priority` (string): Location priority - 'high_accuracy', 'balanced_power_accuracy', 'low_power', 'no_power' (default: 'high_accuracy')\n  - `interval` (number): Update interval in milliseconds (default: 1000)\n  - `fastestInterval` (number): Fastest update interval in milliseconds (default: 1000)\n  - `smallestDisplacement` (number): Minimum displacement for updates in meters (default: 0)\n\n**Returns:** `Promise<LocationData>` - Resolves with location data\n\n**Example:**\n\n```javascript\nconst location = await Geolocation.getCurrentLocation({\n  enableHighAccuracy: true,\n  timeout: 10000,\n  priority: \"high_accuracy\",\n});\n```\n\n### `Geolocation.watchLocation(callback, options)`\n\nWatch for location changes continuously.\n\n**Parameters:**\n\n- `callback` (Function): Function called with (location, error)\n  - `location`: LocationData object or null\n  - `error`: Error string or null\n- `options` (Object, optional): Same as getCurrentLocation\n\n**Returns:** `Promise<number>` - Resolves with watchId\n\n**Example:**\n\n```javascript\nconst watchId = await Geolocation.watchLocation(\n  (location, error) => {\n    if (error) {\n      console.error(\"Location error:\", error);\n    } else {\n      console.log(\"New location:\", location);\n    }\n  },\n  {\n    enableHighAccuracy: true,\n    interval: 2000,\n    smallestDisplacement: 5,\n  }\n);\n```\n\n### `Geolocation.stopWatching(watchId)`\n\nStop watching location changes.\n\n**Parameters:**\n\n- `watchId` (number): The watch ID returned by watchLocation\n\n**Returns:** `Promise<void>` - Resolves when watching stops\n\n**Example:**\n\n```javascript\nawait Geolocation.stopWatching(watchId);\n```\n\n### `Geolocation.checkPermissions()`\n\nCheck current permission status.\n\n**Returns:** `Promise<{fine: boolean, background: boolean}>` - Permission status\n\n**Example:**\n\n```javascript\nconst permissions = await Geolocation.checkPermissions();\nconsole.log(\"Fine location:\", permissions.fine);\nconsole.log(\"Background location:\", permissions.background);\n```\n\n### `Geolocation.requestPermissions()`\n\nRequest location permissions from the user.\n\n**Returns:** `Promise<{fine: boolean, background: boolean}>` - Permission status after request\n\n**Example:**\n\n```javascript\nconst permissions = await Geolocation.requestPermissions();\nif (permissions.fine) {\n  console.log(\"Location permission granted!\");\n}\n```\n\n### `Geolocation.isLocationEnabled()`\n\nCheck if location services are enabled on the device.\n\n**Returns:** `Promise<boolean>` - True if location services are enabled\n\n**Example:**\n\n```javascript\nconst enabled = await Geolocation.isLocationEnabled();\nif (!enabled) {\n  Alert.alert(\"Location Services\", \"Please enable location services in settings\");\n}\n```\n\n## 🔧 Platform-Specific Setup\n\n### Android Setup\n\nThe package automatically handles Android configuration, but you need to add location permissions to your `android/app/src/main/AndroidManifest.xml`:\n\n```xml\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <!-- Location permissions -->\n    <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />\n    <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />\n    <uses-permission android:name=\"android.permission.ACCESS_BACKGROUND_LOCATION\" />\n    <uses-permission android:name=\"android.permission.BLUETOOTH_SCAN\" />\n</manifest>\n```\n\n### iOS Setup\n\nFor iOS, you need to add location usage descriptions to your `ios/YourApp/Info.plist`:\n\n```xml\n<key>NSLocationWhenInUseUsageDescription</key>\n<string>This app needs access to location when open.</string>\n<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>\n<string>This app needs access to location when open and in the background.</string>\n```\n\n**Optional:** For background location tracking, add background modes:\n\n```xml\n<key>UIBackgroundModes</key>\n<array>\n    <string>location</string>\n</array>\n```\n\n## 🎯 Use Cases\n\n- **Location Tracking**: Track user location for fitness apps\n- **Navigation**: Real-time navigation and routing\n- **Geofencing**: Location-based notifications and actions\n- **Asset Tracking**: Track vehicles, equipment, or packages\n- **Social Features**: Location-based social networking\n- **Emergency Services**: Emergency location sharing\n- **Delivery Apps**: Real-time delivery tracking\n- **Weather Apps**: Location-based weather information\n\n## 📱 Example Implementation\n\n```javascript\nimport React, { useEffect, useState } from \"react\";\nimport { View, Text, TouchableOpacity, Alert } from \"react-native\";\nimport Geolocation from \"@amrshbib/react-native-geolocation\";\n\nconst App = () => {\n  const [location, setLocation] = useState(null);\n  const [permissions, setPermissions] = useState({ fine: false, background: false });\n  const [watchId, setWatchId] = useState(null);\n  const [isWatching, setIsWatching] = useState(false);\n\n  useEffect(() => {\n    checkPermissions();\n    return () => {\n      if (watchId) {\n        Geolocation.stopWatching(watchId);\n      }\n    };\n  }, []);\n\n  const checkPermissions = async () => {\n    try {\n      const perms = await Geolocation.checkPermissions();\n      setPermissions(perms);\n    } catch (error) {\n      console.error(\"Error checking permissions:\", error);\n    }\n  };\n\n  const requestPermissions = async () => {\n    try {\n      const perms = await Geolocation.requestPermissions();\n      setPermissions(perms);\n      if (perms.fine) {\n        Alert.alert(\"Success\", \"Location permissions granted!\");\n      } else {\n        Alert.alert(\"Permission Required\", \"Please grant location permission to use this feature.\");\n      }\n    } catch (error) {\n      Alert.alert(\"Error\", \"Failed to request permissions\");\n    }\n  };\n\n  const getCurrentLocation = async () => {\n    try {\n      if (!permissions.fine) {\n        Alert.alert(\"Permission Required\", \"Please grant location permission first.\");\n        return;\n      }\n\n      const loc = await Geolocation.getCurrentLocation({\n        enableHighAccuracy: true,\n        timeout: 15000,\n        priority: \"high_accuracy\",\n      });\n\n      setLocation(loc);\n      Alert.alert(\"Success\", `Location: ${loc.latitude}, ${loc.longitude}`);\n    } catch (error) {\n      if (error.message && error.message.includes(\"permissions not granted\")) {\n        Alert.alert(\"Permission Required\", \"Location permission is required.\");\n      } else {\n        Alert.alert(\"Error\", error.message || \"Failed to get location\");\n      }\n    }\n  };\n\n  const startWatching = async () => {\n    try {\n      if (!permissions.fine) {\n        Alert.alert(\"Permission Required\", \"Please grant location permission first.\");\n        return;\n      }\n\n      const id = await Geolocation.watchLocation(\n        (loc, error) => {\n          if (error) {\n            console.error(\"Location watch error:\", error);\n            Alert.alert(\"Location Error\", error);\n          } else {\n            setLocation(loc);\n          }\n        },\n        {\n          enableHighAccuracy: true,\n          interval: 1000,\n          priority: \"high_accuracy\",\n        }\n      );\n\n      setWatchId(id);\n      setIsWatching(true);\n    } catch (error) {\n      Alert.alert(\"Error\", error.message || \"Failed to start location watching\");\n    }\n  };\n\n  const stopWatching = () => {\n    if (watchId) {\n      Geolocation.stopWatching(watchId);\n      setWatchId(null);\n      setIsWatching(false);\n    }\n  };\n\n  return (\n    <View style={{ flex: 1, padding: 20 }}>\n      <Text style={{ fontSize: 24, marginBottom: 20 }}>Geolocation Demo</Text>\n\n      <View style={{ marginBottom: 20 }}>\n        <Text>Fine Location: {permissions.fine ? \"✅ Granted\" : \"❌ Denied\"}</Text>\n        <Text>Background Location: {permissions.background ? \"✅ Granted\" : \"❌ Denied\"}</Text>\n      </View>\n\n      {!permissions.fine && (\n        <TouchableOpacity\n          onPress={requestPermissions}\n          style={{\n            backgroundColor: \"#007AFF\",\n            padding: 15,\n            borderRadius: 8,\n            marginBottom: 20,\n          }}\n        >\n          <Text style={{ color: \"white\", textAlign: \"center\", fontSize: 18 }}>Request Permissions</Text>\n        </TouchableOpacity>\n      )}\n\n      <TouchableOpacity\n        onPress={getCurrentLocation}\n        style={{\n          backgroundColor: \"#34C759\",\n          padding: 15,\n          borderRadius: 8,\n          marginBottom: 10,\n        }}\n      >\n        <Text style={{ color: \"white\", textAlign: \"center\", fontSize: 18 }}>Get Current Location</Text>\n      </TouchableOpacity>\n\n      <TouchableOpacity\n        onPress={isWatching ? stopWatching : startWatching}\n        style={{\n          backgroundColor: isWatching ? \"#FF3B30\" : \"#FF9500\",\n          padding: 15,\n          borderRadius: 8,\n          marginBottom: 20,\n        }}\n      >\n        <Text style={{ color: \"white\", textAlign: \"center\", fontSize: 18 }}>{isWatching ? \"Stop Watching\" : \"Start Watching\"}</Text>\n      </TouchableOpacity>\n\n      {location && (\n        <View style={{ backgroundColor: \"#f0f0f0\", padding: 15, borderRadius: 8 }}>\n          <Text style={{ fontSize: 18, marginBottom: 10 }}>Current Location:</Text>\n          <Text>Latitude: {location.latitude}</Text>\n          <Text>Longitude: {location.longitude}</Text>\n          <Text>Accuracy: {location.accuracy}m</Text>\n          <Text>Speed: {location.speed} m/s</Text>\n          <Text>Heading: {location.heading}°</Text>\n          <Text>Provider: {location.provider}</Text>\n        </View>\n      )}\n    </View>\n  );\n};\n\nexport default App;\n```\n\n## ⚠️ Important Notes\n\n### Android\n\n- Uses Google's FusedLocationProviderClient for optimal battery usage\n- Background location requires additional permission on Android 10+\n- Location accuracy depends on GPS signal strength and device capabilities\n\n### iOS\n\n- Uses CoreLocation framework for location services\n- Background location is limited by iOS system policies\n- Location services must be enabled by the user\n\n## 🔧 Troubleshooting\n\n### Permission Denied Error\n\n1. Check if location permissions are granted\n2. Request permissions using `Geolocation.requestPermissions()`\n3. Guide user to app settings if permissions are denied\n\n### Location Services Disabled\n\n1. Check if location services are enabled using `Geolocation.isLocationEnabled()`\n2. Guide user to enable location services in device settings\n\n### No Location Updates\n\n1. Ensure permissions are granted\n2. Check if location services are enabled\n3. Verify GPS signal strength\n4. Try different priority levels\n\n### High Battery Usage\n\n1. Use `balanced_power_accuracy` or `low_power` priority\n2. Increase `interval` and `fastestInterval` values\n3. Use `smallestDisplacement` to reduce unnecessary updates\n\n## 📋 Requirements\n\n- React Native 0.60+\n- Android API 21+ (Android 5.0+)\n- iOS 10.0+\n- Kotlin support (Android)\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📄 License\n\nThe MIT License\n\nCopyright (c) 2024 Amr Shbib <amr.shbib@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## 🔗 Links\n\n- [npm Package](https://www.npmjs.com/package/@amrshbib/react-native-geolocation)\n\n---\n\nMade with ❤️ for the React Native community\n","readmeFilename":"README.md"}