> ## Documentation Index
> Fetch the complete documentation index at: https://docs.radar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Test, troubleshoot, and go live

> Reproduce a successful and a failed Radar workflow in the Test environment, inspect why each result happened, fix common problems, and work through a go-live checklist.

By the end of this page, you will be able to reproduce a passing and a failing result on a test device, see why Radar produced each one, and run a checklist before you switch to Live keys.

## Start from the symptom

| Symptom | Start here |
| - | - |
| The device never appears in the Radar dashboard | [Device doesn't appear in the dashboard](#device-doesnt-appear-in-the-dashboard) |
| Geofence or place events don't fire, or fire only in the foreground | [Events don't fire](#events-dont-fire) |
| Your listener or receiver is never called | [Listeners don't deliver](#listeners-dont-deliver) |
| A location check passes or fails when you expect the opposite | [Inspect what happened](#inspect-what-happened) |
| You can't produce a failed check to test your blocked screen | [Force a pass or a fail](#force-a-pass-or-a-fail) |
| The SDK returns an error status | [Test the failure paths](#test-the-failure-paths) |

## Set up a safe test environment

* **Test keys**: Initialize development builds with `prj_test_pk_...`, and switch the dashboard to Test. See [Choose the right API key](https://docs.radar.com/fundamentals/authentication-and-access.md#choose-the-right-api-key).
* **Named test users**: Give each tester a fixed `userId` that is clearly not a customer, for example `test-user-123`, so that you can scope rules to it and clean up afterwards.
* **Debug logging**: In development builds, raise the log level to see each request and response:

```swift Swift theme={null}
import RadarSDK

Radar.setLogLevel(RadarLogLevel.debug)
```

```kotlin Kotlin theme={null}
import io.radar.sdk.Radar

Radar.setLogLevel(Radar.RadarLogLevel.DEBUG)
```

## Force a pass or a fail

To test a failed verified location check without travelling, or a passing check from a place where checks normally fail, scope a rule to one named test user in the Test environment. A block rule needs the Write role, and a bypass rule needs Admin.

> [!WARNING]
>
> Bypass rules are for internal testing only. Never apply them to real end users.

To block the test user and confirm the rejection:

1. In the dashboard, open the **Block rules** page and click **Create**. Match on the user ID, enter `test-user-123`, add a description, and select **Blocked**.
2. Sign in to your app as `test-user-123` and trigger a check. The token returns `passed` set to `false`, `failureReasons` containing `fraud_blocked_user_id`, and `user.fraud.blocked` set to `true`. Your app shows its blocked state.
3. Send the protected request directly to your backend with the failed token. Your backend must reject it. If the request succeeds, your backend is trusting the client instead of reading `passed` from the verified token.

To pass checks for a tester who is outside your allowed area or on a development device:

1. Create a rule the same way, and select **Bypassed**. To limit the rule, restrict it to specific countries or states, or to specific failure reasons in **Bypassed failure reasons**.
2. Run a check as the test user. The token returns `passed` set to `true` and `user.fraud.bypassed` set to `true`, and your backend performs the action.

Your backend can read `user.fraud.bypassed` to tell a bypassed pass from a regular one. In production, consider rejecting tokens with `user.fraud.bypassed` set to `true` unless the user is on your internal tester list.

To test one specific failure reason or location, open the user or device in the dashboard, open its menu, and select **Set override**.

To clean up:

1. Disable or delete each rule you created for the test user, and remove any override.
2. Run one more check. Confirm that `user.fraud.blocked` and `user.fraud.bypassed` are both `false`.
3. Confirm that no bypass rule exists in the Live environment for a real user.

## Test location and movement

* **Dashboard**: On the [Simulator](https://dashboard.radar.com/geofencing/simulate) page, click the map to generate location updates and events without a device. Simulated events are sent to your integrations, so simulate in Test.
* **SDK**: `Radar.mockTracking()` sends mock location updates along a route, to exercise geofence and trip events. It doesn't produce verified location checks.
* **Physical device**: Confirm final results on real hardware. Fraud checks can flag a simulator or emulator. Start outside the geofence: a device must be seen outside a geofence before Radar generates another entry event for it.

## Inspect what happened

Open the [Users](https://dashboard.radar.com/geofencing/users) page and filter by your test `userId`, shown as **External ID**. The user shows their last location and the geofences and places they are in.

Each verified location check is listed on the [Locations](https://dashboard.radar.com/geofencing/locations) page. Filter by user ID, IP address, or jurisdiction, then open the check to see whether it passed and its failure reasons.

## Test the failure paths

A check that can't complete returns an error status and no token. Reproduce each of these on a device:

| Condition | How to reproduce | Expected behavior |
| - | - | - |
| No network | Turn on airplane mode, then trigger a location call. | `ERROR_NETWORK`. Your app shows a retry option. |
| Permission denied | Deny location, or turn it off in Settings. | `ERROR_PERMISSIONS`, and the no-location experience. |
| Location unavailable | Turn off location services for the device. | `ERROR_LOCATION`, with guidance to turn location on. |
| Stale result | Complete a check, wait until after its expiry time, then attempt the protected action. | Your backend rejects the expired result and your app requests a new check. |
| App terminated | Force quit the app during a trip, then reopen it. | Your app reads the current trip state and resumes or ends tracking. |
| User switches account | Log out and log in as a second test user on the same device. | The next location or check is attributed to the second user. |

When an action depends on a passing check, treat every error status as "not verified". Never allow the action because a request failed. Make the final decision on your backend from a validated token. See [Geolocation token schema](https://docs.radar.com/api/geolocation-tokens.md).

## Fix common problems

### Device doesn't appear in the dashboard

A device appears after its first successful track request. Confirm that location permission is granted, that the SDK is initialized at app launch with the publishable key for the environment the dashboard is showing, and that `Radar.trackOnce()` is called. With debug logging on, a successful track request logs a `200` status code for `POST https://api.radar.io/v1/track`.

### Events don't fire

1. Check the time of the user's last location in the dashboard, to confirm that an update arrived.
2. Confirm that events are turned on for the [context type](https://docs.radar.com/fundamentals/context-types.md) on the [Settings](https://dashboard.radar.com/settings) page.
3. For events in the background, confirm that you called `Radar.startTracking()`, that background permission is granted and, on iOS, that the Location updates background mode is on when you use the responsive or continuous preset.
4. Confirm that the device moved enough to trigger an update under your [tracking options](https://docs.radar.com/sdk/tracking.md), and was seen outside the geofence first.

### Listeners don't deliver

A listener is called only when an event is generated, so first confirm that the event appears in the dashboard. Then check where the listener is registered: on iOS, set the `RadarDelegate` at app launch, and on Android, register the `RadarReceiver` in your `Application` class. In cross-platform frameworks, register listeners outside the view lifecycle so that they exist when the app is launched in the background.

### Another location SDK is installed

On iOS, significant location change, region, and visit events can be delivered to every `CLLocationManager` in the app, so the Radar SDK may receive location updates that another SDK triggered, even before you call a Radar tracking method. This doesn't happen on Android.

### Measure battery use

Install two builds of your app on the same device model, one with Radar background tracking and one without. Use the phone normally for a full day without opening either app, then compare them on the Battery screen in the device settings. That screen shows each app's share of the battery used in that period, not a share of the full battery.

## Create, save, and subscribe to reports

You need the Write role or above to save a report or create a subscription.

1. Open the analysis view from the Locations page. Choose a chart type or a table, then set filters, the date range, and columns.
2. Click **Save** and enter a title and description.
3. Open the saved report. Export it for a one-time file, or click **Subscribe to report** and enter the recipients' email addresses and the frequency.

## Roll out gradually

Before you enforce a new check, run it alongside the one it replaces: your current provider stays in control, your app also runs a Radar check at the same moments, and your backend records the Radar result without enforcing it.

* **Shadow traffic can create history and risk signals**: Shadow checks are real checks. They create user and device records and location history in Radar, and they can contribute to fraud flags and risk scores. Agree with your Radar account team how that history is handled when you start enforcing.
* **Compare**: Look at pass rate, failure reasons, technical error rate, and latency, and review a sample of the checks where the two providers disagree.
* **Switch**: Enforce in stages, behind a server-side flag that your backend reads on each restricted request.
* **Roll back**: Rollback is the same flag turned off. Keep the previous integration deployable until the final stage is complete.

## Go-live checklist

* [ ] Production builds use the Live publishable key, and production backends use the Live secret key from a secret store.
* [ ] Website and mobile restrictions are set on your publishable keys.
* [ ] Live settings match what you tested in Test: geofences, event types, tracking options, integrations, webhooks, and, for Geo-compliance, jurisdiction settings.
* [ ] Debug logging is off in production builds.
* [ ] No test block rule, bypass rule, or override remains in Live.
* [ ] You reproduced one successful and one failed workflow on a physical iPhone and a physical Android device, and tested every row in [Test the failure paths](#test-the-failure-paths).
* [ ] The permission flow passes the checks in [Verify your permission flow](https://docs.radar.com/fundamentals/location-permissions.md#verify-your-permission-flow).
* [ ] Your backend, not the client, makes the final decision for protected actions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.