Skip to content

[expo-location][ios] Add accuracy authorization to permission response#42931

Merged
jakex7 merged 5 commits intoexpo:mainfrom
sbs44:feat/location-accuracy-authorization
Feb 20, 2026
Merged

[expo-location][ios] Add accuracy authorization to permission response#42931
jakex7 merged 5 commits intoexpo:mainfrom
sbs44:feat/location-accuracy-authorization

Conversation

@sbs44
Copy link
Copy Markdown
Contributor

@sbs44 sbs44 commented Feb 6, 2026

Summary

Exposes CLAccuracyAuthorization (iOS 14+) in PermissionDetailsLocationIOS so apps can detect when a user has disabled "Precise Location" in Settings.

Reads CLLocationManager.accuracyAuthorization in the three iOS permission requesters and returns "accuracy": "full" | "reduced" alongside the existing scope field. This brings iOS to parity with PermissionDetailsLocationAndroid, which already exposes accuracy.

Closes #42930

Changes

  • src/Location.types.ts / build/Location.types.d.ts — Add accuracy: 'full' | 'reduced' to PermissionDetailsLocationIOS
  • ios/Requesters/EXForegroundPermissionRequester.m — Read CLAccuracyAuthorization, include in return dict
  • ios/Requesters/EXBackgroundLocationPermissionRequester.m — Same
  • ios/Requesters/EXLocationPermissionRequester.m — Same
  • CHANGELOG.md — Entry under Unpublished > New features

Test Plan

  • Verified on iPhone simulator (iOS 18/26): toggling Precise Location off returns accuracy: 'reduced', toggling back on returns accuracy: 'full'
  • Running in production for 3+ months via patch-package in a navigation app

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 6, 2026

Subscribed to pull request

File Patterns Mentions
packages/expo-location/** @behenate, @lukmccall

Generated by CodeMention

@expo-bot expo-bot added the bot: passed checks ExpoBot has nothing to complain about label Feb 6, 2026
@vonovak vonovak requested a review from Copilot February 11, 2026 14:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exposes iOS 14+ CLAccuracyAuthorization in expo-location permission results so apps can detect whether “Precise Location” is enabled, aligning iOS permission details more closely with Android’s accuracy reporting.

Changes:

  • Add accuracy: 'full' | 'reduced' to PermissionDetailsLocationIOS TypeScript types.
  • Read CLLocationManager.accuracyAuthorization in iOS foreground/background/general location permission requesters and include it in the returned permission payload.
  • Document the new field in the package changelog.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/expo-location/src/Location.types.ts Adds accuracy to the exported iOS permission details type.
packages/expo-location/build/Location.types.d.ts Updates generated declaration output to match the new TS type.
packages/expo-location/ios/Requesters/EXLocationPermissionRequester.m Includes iOS accuracy authorization in parsed permission results.
packages/expo-location/ios/Requesters/EXForegroundPermissionRequester.m Includes iOS accuracy authorization in parsed permission results.
packages/expo-location/ios/Requesters/EXBackgroundLocationPermissionRequester.m Includes iOS accuracy authorization in parsed permission results.
packages/expo-location/CHANGELOG.md Adds an Unpublished changelog entry for the new iOS field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lukmccall lukmccall requested a review from jakex7 February 12, 2026 13:53
@sbs44
Copy link
Copy Markdown
Contributor Author

sbs44 commented Feb 14, 2026

Addressed review feedback in dcd8362:

  • Made accuracy optional on PermissionDetailsLocationIOS to avoid breaking consumers
  • Extracted accuracyAuthorizationString to EXBaseLocationRequester — eliminates duplication across all three requesters
  • Reuses self.locationManager when available, only allocates a temporary instance when called outside the permission request flow

…ponse

Read CLLocationManager.accuracyAuthorization (iOS 14+) in all three
permission requesters and include it in the returned dictionary as
"accuracy": "full" | "reduced".

Closes expo#42930
- Extract accuracyAuthorizationString to base class
- Reuse self.locationManager instead of allocating new instances
- Make accuracy optional on PermissionDetailsLocationIOS
@sbs44 sbs44 force-pushed the feat/location-accuracy-authorization branch from dcd8362 to 52964bc Compare February 14, 2026 06:29
Copy link
Copy Markdown
Member

@jakex7 jakex7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I made a small change, because Copilot suggestion was misleading here.

@sbs44
Copy link
Copy Markdown
Contributor Author

sbs44 commented Feb 16, 2026

@jakex7 appreciate the review! I noticed the check-packages CI failure is due to stale source maps (build/Location.types.d.ts.map, build/Location.types.js.map)… I manually edited the .d.ts build artifact instead of regenerating it. Should I run yarn build in the package and push the rebuilt artifacts?

The other two failures (ios-build timeout, android-test-e2e) appear unrelated to this PR.

Apply suggestion from @jakex7: accuracy is always present in the
native response so the type stays required. Clarify that iOS <14
always returns 'full'.
@jakex7 jakex7 merged commit 416b227 into expo:main Feb 20, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: passed checks ExpoBot has nothing to complain about

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[expo-location][ios] Add accuracy authorization to permission response

4 participants