Skip to content

Comments

fix(android): request ACCESS_MEDIA_LOCATION for GPS data#21

Merged
lodev09 merged 1 commit intomainfrom
fix/android-gps-location
Feb 8, 2026
Merged

fix(android): request ACCESS_MEDIA_LOCATION for GPS data#21
lodev09 merged 1 commit intomainfrom
fix/android-gps-location

Conversation

@lodev09
Copy link
Owner

@lodev09 lodev09 commented Feb 8, 2026

Summary

Fix GPS location data not showing on Android 10+ when reading from content:// URIs. The OS redacts GPS EXIF data unless ACCESS_MEDIA_LOCATION is granted.

  • Declare ACCESS_MEDIA_LOCATION in AndroidManifest.xml (auto-merged into app manifest)
  • Auto-request the permission at runtime before reading content:// URIs on API 29+
  • Use MediaStore.setRequireOriginal() to access unredacted EXIF data
  • Falls back gracefully if permission is denied or activity is unavailable

Closes #6

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Test Plan

  • Tested on Android 14 (Pixel 6 Pro) with content:// URI
  • Verified GPS tags are returned after permission grant
  • Verified no crash if permission is denied
  • Verified existing grant from expo-media-library is reused

Checklist

  • I tested on iOS
  • I tested on Android
  • I updated the documentation (if needed)

On Android 10+, GPS EXIF data is redacted from content:// URIs.
Auto-request ACCESS_MEDIA_LOCATION at runtime and use
MediaStore.setRequireOriginal() to access unredacted location data.

Closes #6
@lodev09 lodev09 merged commit 082fc72 into main Feb 8, 2026
3 checks passed
@lodev09 lodev09 deleted the fix/android-gps-location branch February 8, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Location Data Not Showing on Android Pixel 6 Pro

1 participant