GPS / GNSS in Mobile Apps: A Practical Guide

Use GPS, GLONASS, Galileo and BeiDou to locate the user in iOS and Android — with accuracy, battery and permission tips.

Timothy Lindblom

Founder, Newly

GPS — more accurately GNSS, the global family of satellite systems including GPS, GLONASS, Galileo and BeiDou — is the highest-impact sensor in modern apps. Maps, ride-hailing, fitness tracking and food delivery all live or die by getting location right. It is also the easiest sensor to misuse: ask for too much accuracy or run in the background carelessly and you will drain the battery and trip the OS's privacy nudges.

Get Current Location, Geocode and Reverse Geocode with expo-location· MissCodingWatch on YouTube ↗

Key Takeaways

  • Modern phones combine satellites with Wi-Fi and cell signals — what you read is a fused position, not raw GPS.
  • iOS and Android both require explicit user permission, and modern OS versions show a "while-using" vs "always" choice.
  • Choose the lowest accuracy mode that works for your use case — battery savings can be 5–10x.
  • Background location is heavily restricted on both platforms; use significant-change or geofencing APIs instead of high-rate streams.

GPS / GNSS at a Glance

~3–10 m
Typical horizontal accuracy
4
Constellations on most phones
10s+
Cold-start time to first fix
Always-prompt
On iOS 14+ / Android 11+

What It Is & How It Works

What it is. A GNSS receiver triangulates the device position by timing signals from satellites. The OS layers in Wi-Fi, cell-tower and barometric data to give you a fused location estimate that is far better than raw GPS would be alone.

How it works. You request a location authorisation, then either subscribe to continuous updates or call a "current location" API. The system picks providers (satellites, Wi-Fi, cell) based on the accuracy you ask for.

Units & signal. Latitude / longitude in decimal degrees (WGS84). Accuracy in metres. Speed in m/s. Heading (course) in degrees from true north — only available when the device is moving.

What You Can Build With It

Maps and navigation

Show the user on a map, draw routes, and give turn-by-turn directions.

Example: A bike-route planner that shows your live location.

Geofences

Trigger an action when the user enters or leaves a region — without keeping GPS active.

Example: A reminder app that pings when you arrive home.

Fitness tracking

Record routes, distance and pace for runs, rides and hikes.

Example: A running app that maps the user's route and computes pace per km.

Hyperlocal content

Use coarse location to surface nearby restaurants, weather, or events.

Example: A weather widget that knows the user is now in a different city.

Permissions & Setup

Both platforms show a system dialog the first time you request location. iOS additionally lets the user grant "approximate" or "precise" location — your app keeps working at lower accuracy if they choose approximate.

iOS · Info.plist

  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysAndWhenInUseUsageDescription (background)
  • UIBackgroundModes: location (for background updates)

Android · AndroidManifest.xml

  • android.permission.ACCESS_COARSE_LOCATION
  • android.permission.ACCESS_FINE_LOCATION
  • android.permission.ACCESS_BACKGROUND_LOCATION (Android 10+ for background)

Background location requires extra OS approval and clear copy in the prompt. Apps that abuse it are routinely rejected by App Review.

Code Examples

Setup

  • Expo: `npx expo install expo-location`
  • iOS: import CoreLocation; add the relevant Info.plist entries
  • Android: use the FusedLocationProviderClient from Google Play Services
import * as Location from 'expo-location';

export async function getCurrentPosition() {
  const { status } = await Location.requestForegroundPermissionsAsync();
  if (status !== 'granted') throw new Error('Permission denied');

  const loc = await Location.getCurrentPositionAsync({
    accuracy: Location.Accuracy.Balanced, // ~100m, much cheaper than High
  });

  return {
    lat: loc.coords.latitude,
    lng: loc.coords.longitude,
    accuracyMeters: loc.coords.accuracy,
  };
}

Tip: With Newly, you describe the feature you want and the AI agent wires up the sensor, permissions, and UI for you. Try it free.

Best Practices

  • Pick the cheapest accuracy that works

    `Balanced` (≈100 m) is plenty for "show nearby". Reserve high accuracy for navigation or fitness tracking.

  • Cache and reuse

    A 30-second-old position is usually fine. Don't request a fresh fix on every screen mount.

  • Use geofencing or significant-change for background

    These APIs wake your app on important changes only; both iOS and Android optimise them aggressively.

  • Explain why you need location

    Both stores reject vague or scary permission strings. One sentence, one user benefit.

  • Handle "approximate location"

    On iOS 14+ and Android 12+, users can grant only approximate location. Make sure your app still works.

Common Pitfalls

Polling at high frequency

GPS-only at 1 Hz can drain a battery in a few hours.

Mitigation: Use `Balanced` accuracy for normal updates; only request high accuracy during active navigation.

Background usage rejection

Apps requesting "Always" without an obvious need are rejected at submission time.

Mitigation: Use significant-change / geofences and request "Always" with a clear, in-context rationale.

Indoor inaccuracy

GPS struggles indoors and in urban canyons; accuracy can be hundreds of metres.

Mitigation: Show the accuracy circle on the map; rely on Wi-Fi / BLE for indoor positioning.

Cold start latency

A cold-started GPS can take 10–30 s to get a fix.

Mitigation: Use the cached `lastKnownLocation` immediately and refine when a fresh fix arrives.

When To Use It (And When Not To)

Good fit

  • Outdoor maps, navigation and fitness tracking
  • Geofenced reminders and notifications
  • Hyperlocal content like nearby weather, restaurants, transit
  • Logistics and delivery driver apps

Look elsewhere if…

  • Indoor positioning — use Wi-Fi RTT, BLE beacons or UWB
  • High-frequency tracking with "Always" permission for trivial reasons
  • Sub-metre accuracy without an external RTK receiver
  • Tracking other people's devices — you cannot read another phone's GPS

Frequently Asked Questions

Is GPS the same as GNSS?

GPS is the US satellite constellation. GNSS is the umbrella term for all satellite navigation systems (GPS, GLONASS, Galileo, BeiDou, QZSS). Modern smartphones use multiple GNSS for faster, more accurate fixes.

How can I reduce battery use?

Lower accuracy, longer update intervals, geofencing instead of streaming, stop updates when the screen is off.

Why is my reported accuracy 65 m when the docs say "GPS is accurate to 3 m"?

You read the OS's confidence interval, which is conservative and includes Wi-Fi/cell-derived positions. Indoors, "65 m" is honest.

Can I run GPS in the background?

Yes, but it requires extra permission, an explicit user benefit, and store review approval. Geofencing or significant-change is almost always a better choice.

Build with the GPS on Newly

Ship a gps-powered feature this week

Newly turns a description like “use the gps to maps and navigation into a real React Native app — permissions, native modules and UI included. Full source code is yours, and you can publish to the App Store and Google Play directly from the dashboard.

Start Building Your App

Want a deeper dive on the underlying APIs? See Expo Sensors, Apple Core Motion and Android sensor framework.

Continue Learning