{"_id":"@alihamzaazhar/react-native-location-settings","_rev":"6-920cf85d0695c2731f3cf53caae80b74","name":"@alihamzaazhar/react-native-location-settings","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@alihamzaazhar/react-native-location-settings","version":"1.0.0","keywords":["react-native","android","location","gps","turbo-module","new-architecture"],"author":{"name":"Ali Hamza"},"license":"MIT","_id":"@alihamzaazhar/react-native-location-settings@1.0.0","maintainers":[{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"}],"homepage":"https://github.com/alihamzaazhar/react-native-location-settings#readme","bugs":{"url":"https://github.com/alihamzaazhar/react-native-location-settings/issues"},"dist":{"shasum":"1ca5ede858a056b637ff69c8aca70af2d515edf4","tarball":"https://registry.npmjs.org/@alihamzaazhar/react-native-location-settings/-/react-native-location-settings-1.0.0.tgz","fileCount":18,"integrity":"sha512-XjGKnxasq5+0+q0SjIqKAGZDeMxA756SUuNNqG2ppOc/9J99OCGlFjQxvKoKFTWkkaUJ6mOe7VJ0VXrPQi0NFQ==","signatures":[{"sig":"MEUCIQCLbrHzvd7Wpgb2UKw/wo/oHHU5BcOEplHFAiTICAE8zgIgJebF56wJ4cDaqMPD2Pjm4j4z0E2YNPxfmLJedKyRmf4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11542},"main":"lib/commonjs/index","types":"lib/typescript/index.d.ts","module":"lib/module/index","source":"src/index","scripts":{"prepare":"bob build","typescript":"tsc --noEmit"},"_npmUser":{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"},"platforms":{"ios":false,"android":true},"repository":{"url":"git+https://github.com/alihamzaazhar/react-native-location-settings.git","type":"git"},"_npmVersion":"10.9.7","description":"Android-only in-app location enable dialog for React Native (New Architecture / TurboModule)","directories":{},"_nodeVersion":"22.22.2","react-native":"src/index","codegenConfig":{"name":"RNLocationSettingsSpec","type":"modules","android":{"javaPackageName":"com.locationsettings"},"jsSrcsDir":"src"},"_hasShrinkwrap":false,"devDependencies":{"react":"18.2.0","typescript":"^5.3.0","react-native":"0.76.0","react-native-builder-bob":"^0.30.0","@react-native/babel-preset":"^0.76.0"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-location-settings_1.0.0_1781727518165_0.6430669700298806","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["commonjs",{"esm":true}],["module",{"esm":true}],["typescript"]]}},"1.0.1":{"name":"@alihamzaazhar/react-native-location-settings","version":"1.0.1","keywords":["react-native","android","location","gps","turbo-module","new-architecture"],"author":{"name":"Ali Hamza"},"license":"MIT","_id":"@alihamzaazhar/react-native-location-settings@1.0.1","maintainers":[{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"}],"homepage":"https://github.com/alihamzaazhar/react-native-location-settings#readme","bugs":{"url":"https://github.com/alihamzaazhar/react-native-location-settings/issues"},"dist":{"shasum":"250d37df368ef97e7d7f7fb3a2a98d858b7ab974","tarball":"https://registry.npmjs.org/@alihamzaazhar/react-native-location-settings/-/react-native-location-settings-1.0.1.tgz","fileCount":19,"integrity":"sha512-t8Au9sx9Akmkj9eleb9HHpg85qz9qohxmCLItn5SRl9EPc+qfwVZSerHy+b3vBRmwHZLyGG3RVRYUMpkmlv+zw==","signatures":[{"sig":"MEUCIQDBJBRo9VF+qWEyJy1F2FjikyBBDUM+EmguXxOqHymKdQIgREC7KbQ8ysY1OMdasAfJBsXJMfV/pK6FMveYm1c209I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14878},"main":"lib/commonjs/index","types":"lib/typescript/index.d.ts","module":"lib/module/index","source":"src/index","gitHead":"da6149e01383a93ea9b02579c54ba7bba01b552f","scripts":{"prepare":"bob build","typescript":"tsc --noEmit"},"_npmUser":{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"},"platforms":{"ios":false,"android":true},"repository":{"url":"git+https://github.com/alihamzaazhar/react-native-location-settings.git","type":"git","homepage":"https://github.com/alihamzaazhar/react-native-location-settings"},"_npmVersion":"10.9.7","description":"Android-only in-app location enable dialog for React Native (New Architecture / TurboModule)","directories":{},"_nodeVersion":"22.22.2","react-native":"src/index","codegenConfig":{"name":"RNLocationSettingsSpec","type":"modules","android":{"javaPackageName":"com.locationsettings"},"jsSrcsDir":"src"},"_hasShrinkwrap":false,"devDependencies":{"react":"18.2.0","typescript":"^5.3.0","react-native":"0.76.0","react-native-builder-bob":"^0.30.0","@react-native/babel-preset":"^0.76.0"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-location-settings_1.0.1_1781728502604_0.3331416856904361","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["commonjs",{"esm":true}],["module",{"esm":true}],["typescript"]]}},"1.0.2":{"name":"@alihamzaazhar/react-native-location-settings","version":"1.0.2","keywords":["react-native","android","location","gps","turbo-module","new-architecture"],"author":{"name":"Ali Hamza"},"license":"MIT","_id":"@alihamzaazhar/react-native-location-settings@1.0.2","maintainers":[{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"}],"homepage":"https://github.com/alihamzaazhar/react-native-location-settings#readme","bugs":{"url":"https://github.com/alihamzaazhar/react-native-location-settings/issues"},"dist":{"shasum":"c32d043b8e1a423d7942462fef3aff24fc3135f8","tarball":"https://registry.npmjs.org/@alihamzaazhar/react-native-location-settings/-/react-native-location-settings-1.0.2.tgz","fileCount":20,"integrity":"sha512-s/AcPj3bEaKfq7bZIvR+pHACQ2/gm2A14xOcUX/XW68VAbxsE7L7I7FIX9EpNjYUbZZoRMgbEhKMP00fPR5UYw==","signatures":[{"sig":"MEUCIA5L3JKDqhLv2t997feRe+22dPQCmRtkbmTUi4GiYJQbAiEAriBKuhdm6dmIhJXee+oDiD+g92Ct4H6XJIz4BJjq+ZE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15948},"main":"lib/commonjs/index","types":"lib/typescript/index.d.ts","module":"lib/module/index","source":"src/index","gitHead":"a8a845dc3322ba18516a94228cd7fd61d453fa10","scripts":{"prepare":"bob build","typescript":"tsc --noEmit"},"_npmUser":{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"},"platforms":{"ios":false,"android":true},"repository":{"url":"git+https://github.com/alihamzaazhar/react-native-location-settings.git","type":"git","homepage":"https://github.com/alihamzaazhar/react-native-location-settings"},"_npmVersion":"10.9.7","description":"Android-only in-app location enable dialog for React Native (New Architecture / TurboModule)","directories":{},"_nodeVersion":"22.22.2","react-native":"src/index","codegenConfig":{"name":"RNLocationSettingsSpec","type":"modules","android":{"javaPackageName":"com.locationsettings"},"jsSrcsDir":"src"},"_hasShrinkwrap":false,"devDependencies":{"react":"18.2.0","typescript":"^5.3.0","react-native":"0.76.0","react-native-builder-bob":"^0.30.0","@react-native/babel-preset":"^0.76.0"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-location-settings_1.0.2_1781729016006_0.864296188703978","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["commonjs",{"esm":true}],["module",{"esm":true}],["typescript"]]}},"1.0.3":{"name":"@alihamzaazhar/react-native-location-settings","version":"1.0.3","keywords":["react-native","android","location","gps","turbo-module","new-architecture"],"author":{"name":"Ali Hamza"},"license":"MIT","_id":"@alihamzaazhar/react-native-location-settings@1.0.3","maintainers":[{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"}],"homepage":"https://github.com/alihamzaazhar/react-native-location-settings#readme","bugs":{"url":"https://github.com/alihamzaazhar/react-native-location-settings/issues"},"dist":{"shasum":"24cfae0fe5f4adf44add9ded350e37ad480b3cae","tarball":"https://registry.npmjs.org/@alihamzaazhar/react-native-location-settings/-/react-native-location-settings-1.0.3.tgz","fileCount":20,"integrity":"sha512-4zkfLKuv8pA7Mxu3QPWVvVbasvr5NYf9QNFMD6zJA/wPRzdZ+aBGl6aExZVj//gItROZZ93VmZGnfBKgFTyLSg==","signatures":[{"sig":"MEUCIBJeqgeL/+Wlrh7DJ1+jv0+8zJ+0FK6KtLs3tAbvZzrMAiEAmfvkWNeBmqZgez7/R+x3UawoULW5cGCF2xcf8W1BL58=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16157},"main":"lib/commonjs/index","types":"lib/typescript/index.d.ts","module":"lib/module/index","source":"src/index","gitHead":"b6486d1122c5253026e7efd6df01b0482f261634","scripts":{"prepare":"bob build","typescript":"tsc --noEmit"},"_npmUser":{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"},"platforms":{"ios":false,"android":true},"repository":{"url":"git+https://github.com/alihamzaazhar/react-native-location-settings.git","type":"git","homepage":"https://github.com/alihamzaazhar/react-native-location-settings"},"_npmVersion":"10.9.7","description":"Android-only in-app location enable dialog for React Native (New Architecture / TurboModule)","directories":{},"_nodeVersion":"22.22.2","react-native":"src/index","codegenConfig":{"name":"RNLocationSettingsSpec","type":"modules","android":{"javaPackageName":"com.locationsettings"},"jsSrcsDir":"src"},"_hasShrinkwrap":false,"devDependencies":{"react":"18.2.0","typescript":"^5.3.0","react-native":"0.76.0","react-native-builder-bob":"^0.30.0","@react-native/babel-preset":"^0.76.0"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-location-settings_1.0.3_1781729207733_0.5641077979178941","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["commonjs",{"esm":true}],["module",{"esm":true}],["typescript"]]}},"1.0.4":{"name":"@alihamzaazhar/react-native-location-settings","version":"1.0.4","keywords":["react-native","android","location","gps","turbo-module","new-architecture"],"author":{"name":"Ali Hamza"},"license":"MIT","_id":"@alihamzaazhar/react-native-location-settings@1.0.4","maintainers":[{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"}],"homepage":"https://github.com/alihamzaazhar/react-native-location-settings#readme","bugs":{"url":"https://github.com/alihamzaazhar/react-native-location-settings/issues"},"dist":{"shasum":"421ceb19ee02293dc2df7d5b98e181376aa53cab","tarball":"https://registry.npmjs.org/@alihamzaazhar/react-native-location-settings/-/react-native-location-settings-1.0.4.tgz","fileCount":20,"integrity":"sha512-7uk5Y7y5tHD6tUGWTNrkj0f7y8b8293j50brkGNO8YnwyxYOQGxVtregwwm/QZj4RfMLqBeW/rE1BI87qp09Fg==","signatures":[{"sig":"MEYCIQDoIHKw3F6+wsI/8CPdcH3MLUbp7UcPOm0lytY9VFHBLQIhAIGm2XvP0PkX++ODDhIma5LpsihpK+pFQueQEaxZ4RiB","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16247},"main":"lib/commonjs/index","types":"lib/typescript/index.d.ts","module":"lib/module/index","source":"src/index","gitHead":"ca1ed619754829e6b8604aeb02fb48370835d156","scripts":{"prepare":"bob build","typescript":"tsc --noEmit"},"_npmUser":{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"},"platforms":{"ios":false,"android":true},"repository":{"url":"git+https://github.com/alihamzaazhar/react-native-location-settings.git","type":"git","homepage":"https://github.com/alihamzaazhar/react-native-location-settings"},"_npmVersion":"10.9.7","description":"Android-only in-app location enable dialog for React Native (New Architecture / TurboModule)","directories":{},"_nodeVersion":"22.22.2","react-native":"src/index","codegenConfig":{"name":"RNLocationSettingsSpec","type":"modules","android":{"javaPackageName":"com.locationsettings"},"jsSrcsDir":"src"},"_hasShrinkwrap":false,"devDependencies":{"react":"18.2.0","typescript":"^5.3.0","react-native":"0.76.0","react-native-builder-bob":"^0.30.0","@react-native/babel-preset":"^0.76.0"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-location-settings_1.0.4_1781749722917_0.4205255192150741","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["commonjs",{"esm":true}],["module",{"esm":true}],["typescript"]]}},"1.0.5":{"name":"@alihamzaazhar/react-native-location-settings","version":"1.0.5","description":"Android-only in-app location enable dialog for React Native (New Architecture / TurboModule)","platforms":{"android":true,"ios":false},"main":"lib/commonjs/index","module":"lib/module/index","react-native":"src/index","source":"src/index","types":"lib/typescript/index.d.ts","scripts":{"prepare":"bob build","typescript":"tsc --noEmit"},"keywords":["react-native","android","location","gps","turbo-module","new-architecture"],"repository":{"type":"git","url":"git+https://github.com/alihamzaazhar/react-native-location-settings.git","homepage":"https://github.com/alihamzaazhar/react-native-location-settings"},"author":{"name":"Ali Hamza"},"license":"MIT","peerDependencies":{"react":"*","react-native":"*"},"devDependencies":{"@react-native/babel-preset":"^0.76.0","react":"18.2.0","react-native":"0.76.0","react-native-builder-bob":"^0.30.0","typescript":"^5.3.0"},"codegenConfig":{"name":"RNLocationSettingsSpec","type":"modules","jsSrcsDir":"src","android":{"javaPackageName":"com.locationsettings"}},"react-native-builder-bob":{"source":"src","output":"lib","targets":[["commonjs",{"esm":true}],["module",{"esm":true}],["typescript"]]},"_id":"@alihamzaazhar/react-native-location-settings@1.0.5","gitHead":"9a8b198884d5733b0ef2652704725ef05d68a5f3","bugs":{"url":"https://github.com/alihamzaazhar/react-native-location-settings/issues"},"homepage":"https://github.com/alihamzaazhar/react-native-location-settings#readme","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-MvxksiBIAypsm+bxx4T0cSMqB6M5jKG24PagOUVgZt4pgv7ONL0+FdaEVE/1DwPnXt4j0XUEDccdnwuvz85X+g==","shasum":"6ac412e784c09df7105d05c8daf53a8569022e30","tarball":"https://registry.npmjs.org/@alihamzaazhar/react-native-location-settings/-/react-native-location-settings-1.0.5.tgz","fileCount":20,"unpackedSize":16079,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEGUQazVWEhYZsamFd3nfJTbVs63itNtc4QXBt3+iEFkAiEAkKJa8o1shRl+3NbRleI2qEPUiIHASxTo9Y6vBaxBAfA="}]},"_npmUser":{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"},"directories":{},"maintainers":[{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-location-settings_1.0.5_1781766828927_0.606101014587128"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-17T20:18:37.931Z","modified":"2026-06-18T07:13:49.195Z","1.0.0":"2026-06-17T20:18:38.312Z","1.0.1":"2026-06-17T20:35:02.750Z","1.0.2":"2026-06-17T20:43:36.179Z","1.0.3":"2026-06-17T20:46:47.870Z","1.0.4":"2026-06-18T02:28:43.056Z","1.0.5":"2026-06-18T07:13:49.088Z"},"bugs":{"url":"https://github.com/alihamzaazhar/react-native-location-settings/issues"},"author":{"name":"Ali Hamza"},"license":"MIT","homepage":"https://github.com/alihamzaazhar/react-native-location-settings#readme","keywords":["react-native","android","location","gps","turbo-module","new-architecture"],"repository":{"type":"git","url":"git+https://github.com/alihamzaazhar/react-native-location-settings.git","homepage":"https://github.com/alihamzaazhar/react-native-location-settings"},"description":"Android-only in-app location enable dialog for React Native (New Architecture / TurboModule)","maintainers":[{"name":"alihamzaazhar","email":"alihamza.azhar124@gmail.com"}],"readme":"# @alihamzaazhar/react-native-location-settings\n\nA React Native TurboModule that shows a Google Maps-style in-app dialog to enable system location — powered by Google Play Services `ResolvableApiException`.\n\nInstead of redirecting the user to the Settings app, this library shows the system location dialog **inside your app**, exactly like Google Maps does.\n\n> Requires React Native 0.73+ with New Architecture (TurboModules).\n\n---\n\n## Demo\n\nhttps://github.com/user-attachments/assets/c274d478-ec09-4e5c-b234-0f0652237a98\n\n## How it works\n\nThis library uses Google Play Services SettingsClient to trigger a ResolvableApiException, which presents the system location enable dialog directly within your app. The promise resolves true if location becomes available, or false if the user declines. If system location is already enabled, the promise resolves immediately without showing any dialog.\n\n---\n\n## Installation\n\n```bash\nnpm install @alihamzaazhar/react-native-location-settings\n```\n\n### Android setup\n\n1. **Pin Google Play Services location version**\n\n   In your root `android/build.gradle`, add to the `ext` block:\n\n   ```gradle\n   ext {\n       // ... other versions\n       playServicesLocationVersion = \"21.3.0\"\n   }\n   ```\n\n2. **Add the dependency in `android/app/build.gradle`**\n\n   ```gradle\n   dependencies {\n       implementation \"com.google.android.gms:play-services-location:${playServicesLocationVersion}\"\n   }\n   ```\n\n3. **Add location permissions to `AndroidManifest.xml`**\n\n   ```xml\n   <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />\n   <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />\n   ```\n\n4. **Rebuild the app**\n\n   ```bash\n   npx react-native run-android\n   ```\n\n   No manual linking needed — React Native autolinking handles the rest.\n\n---\n\n## Usage\n\n```typescript\nimport LocationSettings from '@alihamzaazhar/react-native-location-settings';\nimport { PermissionsAndroid } from 'react-native';\n\nasync function setupLocation() {\n  // Calling this shows the in-app GPS enable dialog immediately.\n  // The dialog is displayed DURING this await — no separate step needed.\n  // Resolves true if the user enabled it, false if they dismissed.\n  const systemEnabled = await LocationSettings.checkAndEnableSystemLocation();\n\n  if (!systemEnabled) {\n    // User dismissed the dialog — handle accordingly\n    return;\n  }\n\n  // Step 2: Request app-level location permission\n  const granted = await PermissionsAndroid.request(\n    PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION\n  );\n\n  if (granted === PermissionsAndroid.RESULTS.GRANTED) {\n    // Location is fully ready — start reading GPS\n  }\n}\n```\n\n---\n\n## API\n\n### `checkAndEnableSystemLocation(): Promise<boolean>`\n\nShows the Google Maps-style in-app dialog to enable system location (GPS).\n\n| Return value | Meaning |\n|---|---|\n| `true` | System location is on — either the user just enabled it or it was already on |\n| `false` | User dismissed or tapped \"No thanks\" |\n\n---\n\n## Requirements\n\n| Requirement | Version |\n|---|---|\n| React Native | 0.73+ |\n| Android minSdk | 24+ |\n| Google Play Services | Required on device |\n| New Architecture | Supported (TurboModule) |\n\n---\n\n## License\n\nMIT © [alihamzaazhar](https://github.com/alihamzaazhar)\n","readmeFilename":"README.md"}