Testing
Use this guide to troubleshoot issues with location tracking and event generation.
#
Device is not showing up in the dashboardA device will show up in the Radar dashboard once a successful track API call has been sent to the server. The Radar SDK collects location updates and then sends them to the server via the track API.
#
Common issues- Location permissions have not been granted.
- The Radar SDK has not been properly initialized.
- Radar tracking methods have not been implemented correctly.
#
Troubleshooting steps- Verify location permissions have been granted.
- Verify that initializing the SDK uses the correct publishable key and happens during application launch. This initialization should happen in the
onCreate()
method of theApplication
class on Android and thedidFinishLaunchingWithOptions()
method of theAppDelegate
on iOS. - Call
Radar.trackOnce()
on application launch and log the status in the callback. Refer to the iOS and Android implementations to understand the status values returned. - Call
Radar.setLogLevel()
with a value ofdebug
and monitor for errors in the logs. Refer to the debug logging sections of iOS and Android for more detail.
A successful Radar API request log looks like the following:
2022-11-08 11:33:01.784759-0500 RadarImplementation[6947:250060] 📍 Radar API response | method = POST; url = https://api.radar.io/v1/track; statusCode = 200;
Once a successful API call is made, there will be a corresponding user on the Users page in the dashboard.
Verify that Radar is registering users on the Users page:
#
Events are not firing when the app is backgroundedAs the Radar SDK collects location updates and sends them to the server, it will generate events based on location context (e.g., the device moves into or out of a geofence or starts a trip). Generated events will appear on the Events page in the dashboard if location updates are triggering events as expected. If the device's last location is in a geofence or a place, that information will be displayed on the details page for that user.
#
Common issues- Background location permissions have not been granted.
- Radar events are not enabled on the Settings page in the dashboard.
- Radar tracking methods have not been implemented correctly.
- The test device has issues collecting location updates (e.g., location sensors are not working in the simulator).
- Flawed testing based on the tracking options applied (e.g., geofence stop detection is on, but the device is not dwelling long enough to detect a stop).
#
Troubleshooting steps- Verify that initializing the SDK uses the correct publishable key and happens during application launch. This initialization should happen in the
onCreate()
method of theApplication
class on Android and thedidFinishLaunchingWithOptions()
method of theAppDelegate
on iOS. On iOS, verify that the Location updates background mode has been enabled if using the responsive or continuous presets. - Confirm that events are enabled for the context type you are testing on the Settings page.
- Confirm that you are calling
Radar.startTracking()
. - Determine the behavior needed to trigger location updates based on the tracking options in use and verify that they appear in the Radar dashboard. For example, if the device is stopped in responsive mode, move over 200 meters to trigger a location update. Location updates can be verified on the Users page in the dashboard or on the User Activity page.
- If location updates are still not appearing, call
Radar.setLogLevel()
with a value ofdebug
and monitor for errors in the logs. Refer to the debug logging sections of iOS and Android for more detail.
Verify that events are firing on the Events page:
Verify a device's current geofences on the User details page:
Note: a device needs to exit a geofence before generating a subsequent entry event, so ensure that the device has been detected outside of the geofence prior to testing another entry.
#
Event listeners are not delivering#
Common issues- Radar event listeners are not implemented correctly.
- Radar events are not generating from location updates.
#
Troubleshooting steps- Verify the
RadarDelegate
on iOS andRadarReceiver
on Android are implemented correctly. For cross-platform frameworks such as React Native and Capacitor, ensure that the listeners are set up outside of the view lifecycle. Verify that you are using the correct native SDK version via the Users page in the dashboard. - Verify that expected events are firing when testing the listeners.
- Understand the behavior of each of the listeners. The client location listener (
onClientLocationUpdated
on Android,didUpdateClientLocation
on iOS) is triggered whenever the Radar SDK receives an update from the device. The location updated listener (onLocationUpdated
on Android,didUpdateLocation
on iOS) delivers location updates processed by Radar servers and will return refreshed user context. The Radar events listener (didReceiveEvents
on Android and iOS) will only fire if events are triggered from location updates. - Implement the error listener methods (
onError
on Android,didFail
on iOS) to determine if errors are firing. Review the error messages returned to diagnose the root cause.
#
Troubleshooting other behavior#
Multiple Radar users have the same user ID or device IDThe Radar iOS and Android SDKs automatically generate a unique installId
on every fresh install. Radar creates a new user record for every unique installId
. Multiple user records may have the same userId
value or deviceId
value if they have different installId
values. Multiple users generating without uninstalls indicates a potential issue setting the userId
in the SDK (i.e. passing in null
for the userId
in certain scenarios).
#
Rate limit errors are occurring when tracking locationRadar has device specific rate limits per second, hour and day for the track API endpoint, which sends location updates to Radar. To mitigate rate limits, adjust tracking options to collect locations less frequently. If you hit the per hour or day limits while testing, reinstalling the application with the Radar SDK will reset the rate limits.