Skip to main content

Overview

The RadarDelegate protocol allows you to receive callbacks for location updates, events, errors, and debug logs on the client side. All methods are optional. To set a delegate, use:

Protocol Declaration

Methods

All delegate methods are optional.

didReceiveEvents(_:user:)

Tells the delegate that events were received.
Array<RadarEvent>
required
The events received.
RadarUser
The user, if any.

Example

didUpdateLocation(_:user:)

Tells the delegate that the current user’s location was updated and synced to the server.
CLLocation
required
The location.
RadarUser
required
The current user.

Example

didUpdateClientLocation(_:stopped:source:)

Tells the delegate that the client’s location was updated but not necessarily synced to the server. To receive only server-synced location updates and user state, use didUpdateLocation:user: instead.
CLLocation
required
The location.
Bool
required
A boolean indicating whether the client is stopped.
RadarLocationSource
required
The source of the location.

Example

didFail(status:)

Tells the delegate that a request failed.
RadarStatus
required
The status.

Example

didLog(message:)

Tells the delegate that a debug log message was received.
String
required
The message.

Example

Implementation Example

Here’s a complete example of implementing RadarDelegate:

See Also