expo-quest-location
A fork of expo-location that provides two implementations:
- The default
expo-location behavior using Google Play Services.
- A Meta Quest–compatible implementation that does not rely on Google Play Services.
You can choose which implementation to use with the EXPO_HORIZON environment variable.
This makes it compatible with Meta Quest devices, while remaining a drop-in replacement for expo-location on Android and iOS.
Usage
npx expo install expo-quest-location
- Update your
app.json / app.config.js to replace expo-location with expo-quest-location.
- Prebuild your app with the
export EXPO_HORIZON=1 environment variable set (to return to the type just remove the environment variable: unset EXPO_HORIZON).
- Update your imports:
import * as Location from 'expo-quest-location';
Behavior
- With
EXPO_HORIZON=1 → Uses the Meta Quest–compatible location API (no Google Play Services).
- Without
EXPO_HORIZON → Falls back to the default expo-location behavior (Google Play Services Location API).
- On iOS → The
EXPO_HORIZON flag has no effect; behavior is always the same as expo-location.
This ensures compatibility across Quest, standard Android devices, and iOS.
Features supported on Meta Quest
enableNetworkProviderAsync | ✅ Supported | ✅ Supported | |
getProviderStatusAsync | ✅ Supported | ✅ Supported | |
hasServicesEnabledAsync | ✅ Supported | ✅ Supported | |
requestForegroundPermissionsAsync requestBackgroundPermissionsAsync | ✅ Supported | ✅ Supported | |
getForegroundPermissionsAsync getBackgroundPermissionsAsync | ✅ Supported | ✅ Supported | |
getCurrentPositionAsync watchPositionAsync | ✅ Supported | ✅ Supported | |
getLastKnownPositionAsync | ✅ Supported | ✅ Supported | |
watchHeadingAsync getHeadingAsync | ✅ Supported | ❌ Not supported | Magnetic and accelerometer sensors are not available on Quest. |
geocodeAsync reverseGeocodeAsync | ✅ Supported | ❌ Not supported | The Geocoder is not present on Quest. |
startGeofencingAsync stopGeofencingAsync hasStartedGeofencingAsync | ✅ Supported | ❓ In testing | Meta Horizon Store doesn't support ACCESS_BACKGROUND_LOCATION Android permission. |
startLocationUpdatesAsync stopLocationUpdatesAsync hasStartedLocationUpdatesAsync | ✅ Supported | ❓ In testing | Meta Horizon Store doesn't support ACCESS_BACKGROUND_LOCATION Android permission. |
Contributing
cd expo-quest-location
yarn build
- Install, run and test the library using the example app:
cd ../example
yarn
yarn quest
yarn android
yarn ios
[!NOTE]
You need to prebuild the app to see changes reflected in the example app.
npm publish --access public