Native capabilitiesIntermediate5h

Maps & location.

GPS, map views, and location-aware features.

What are maps and location?

Location-aware apps read the device's GPS and often display a map. The location APIs give you the current position and updates as the user moves; map components render an interactive map with markers and regions for delivery, fitness, social, and travel features.

Why it matters

Location is a powerful, popular capability and a sensitive one. It drains battery, raises privacy concerns, and behaves differently per platform. Using it well — requesting only the precision you need, only when you need it — is both good engineering and a requirement to pass store review.

What to learn

  • Foreground versus background location
  • Accuracy levels and their battery cost
  • Watching position versus a one-time read
  • Rendering a map with markers and regions
  • Location permissions, including "while using"
  • Geocoding addresses to coordinates
  • Privacy expectations and store rules

Common pitfall

Requesting high-accuracy, always-on background location when the feature only needs a rough position while the app is open. It drains battery, alarms users, and draws extra scrutiny from app review. Request the lowest accuracy and narrowest scope that works — usually foreground, "while using" — not the maximum.

Resources

Primary (free):

Practice

Build a screen that requests "while using" location, reads the current position, and shows it on a map with a marker. Add a second marker and center the map region on the user. Done when it works with foreground permission and does not request background or maximum accuracy needlessly.

Outcomes

  • Read current and watched location with appropriate accuracy.
  • Render a map with markers and regions.
  • Request the narrowest location permission that works.
  • Respect battery and privacy in location features.
Back to Mobile roadmap