Skip to main content
By the end of this page, you will know which location permission each Radar feature needs, how to request it in a way each platform accepts, and how to keep your app or site working when the user says no.

Choose permissions by scenario

Request the lowest scope that supports your feature. Foreground means When In Use on iOS, and ACCESS_FINE_LOCATION with ACCESS_COARSE_LOCATION on Android. Background means Always on iOS, and ACCESS_BACKGROUND_LOCATION on Android. Without background access, events are generated only while the app is in use. The web has a single permission and no background access. See Request location on the web.

Request permissions in order

Request foreground access when the user reaches a location feature. Request background access later, as its own step, and only if a feature needs it. Both platforms deliver the user’s choice asynchronously, so start Radar tracking from the callback, not on the line after the request.
For the Flutter background request, see Flutter SDK. Both platforms enforce the order:
  • Separate requests: On iOS, request Always only after When In Use is granted. On Android 11 (API level 30) and later, if you request a foreground permission and ACCESS_BACKGROUND_LOCATION in the same call, the system ignores the request and grants neither.
  • Settings on Android: On Android 11 and later, the background request opens your app’s location settings page, where the user chooses Allow all the time.
  • Limited prompts: On iOS, you can ask to upgrade from When In Use to Always one time. On Android 11 and later, after the user selects Deny more than once, the system stops showing the dialog. After that, the only path is the system Settings app.

Request location on the web

A browser has one location permission for each site and no background access, so the web SDK gets a location only while your page is open.
  • The first location call prompts: There’s no separate request method. The browser shows its prompt the first time your page calls a method that reads the device location, such as Radar.trackOnce(), or Radar.fraud.trackVerified() on the no-download path. Make that call from a user action, such as a button, after your own explanation.
  • HTTPS is required: Browsers give a location only to pages served over HTTPS, with an exception for localhost during development. Inside an iframe, the embedding page must also set allow="geolocation" on the frame.
  • A block is remembered: After the user blocks location for your site, the browser doesn’t prompt again, and the call fails with ERROR_PERMISSIONS (RadarPermissionsError). The user has to allow location in the browser’s site settings.
  • The operating system comes first: Location services must be turned on for the browser in macOS or Windows settings. If they’re off, the call fails even when your site is allowed. Desktop browsers estimate location mostly from nearby Wi-Fi networks, so ask the user to keep Wi-Fi on.
Check the current state before you ask, so that you can explain the prompt or show recovery steps:
With the Radar Verify companion app, the app gets the location instead of the browser, so the user allows location for Radar Verify in the operating system. See Choose the companion app or the no-download path.

Explain the request before the system prompt

The system prompt doesn’t say why you need location. Show your own screen first, and trigger the system prompt only when the user chooses to continue. A good screen is:
  • Transparent: It says what location data you collect and how you use it, and links to your privacy policy.
  • Valuable: It names the feature the user gets, for example pickup timing or nearby offers.
  • Timely: It appears when the user reaches the feature that needs location, not at first launch.
  • Optional: It includes a way to decline, and the app keeps working if they do.
Use a separate screen for background access, shown after foreground access is granted. On iOS, the usage description strings in Info.plist appear inside the system prompt, so write them for your users.

Handle denial, restriction, and revocation

Check the current status every time a location feature starts. A tracking or verification call made without location permission returns ERROR_PERMISSIONS. Show the no-location experience, and don’t retry in a loop.

Keep an active trip tracking with foreground permission

A user who starts a pickup, delivery, or shift has asked for tracking and can see it happening. Both platforms support this with foreground permission and extra configuration. Start the trip while the app is visible.
  1. In Xcode, under Signing & Capabilities, add Background Modes and turn on Location updates and Background fetch.
  2. Track with the continuous preset, which sets the showBlueBar tracking option. iOS then shows the background location indicator while your app uses location in the background.
If the user force quits the app, iOS doesn’t relaunch an app that has only When In Use authorization.
See Track pickups, deliveries, and workers.

Know the limits of background tracking

  • Timing: Background permission doesn’t guarantee when the system delivers a location. With the efficient and responsive presets, the SDK wakes up while the user is moving and shuts down when they stop.
  • Terminated apps: With Always authorization, iOS can relaunch a terminated app only for some update types. See Tracking options. Android keeps delivering after the app is swiped away, but not after Force stop.
  • Missed updates: If the system delivers no update, Radar can’t generate a geofence or trip event for that period.

See permission status for your users

The location permission statistics in the Radar dashboard use four states:

Verify your permission flow

On a physical iPhone and a physical Android device:
  1. Fresh install. Confirm that no system prompt appears until you reach a location feature.
  2. Grant foreground access. Confirm that the foreground feature works and that background tracking hasn’t started.
  3. Continue to the background step. Confirm that it is a separate request.
  4. Decline background access. Confirm that foreground features still work and the app doesn’t ask again on the next launch.
  5. Deny access in Settings, then return to the app. Confirm that tracking stops and the app explains which feature is unavailable.
  6. Start a trip with foreground access only, lock the device, and move. Confirm that locations arrive in the dashboard.
On the web, in a fresh browser profile:
  1. Load the page. Confirm that no browser prompt appears until you start a location feature.
  2. Block the prompt. Confirm that the page explains how to allow location, and that it doesn’t call again in a loop.
  3. Allow location in the site settings and try again. Confirm that the feature works.

Platform references