ActivityTracker | iOS SDK | 2GIS Documentation
iOS SDK

ActivityTracker

Extends: Hashable
public static func == (lhs: ActivityTracker, rhs: ActivityTracker) -> Bool

Returns a Boolean value indicating whether two values are equal.

public convenience init(
    platformContext: Context,
    model: Model,
    speedBound: Double = 4.2,
    timeThreshold: TimeInterval = 20
)

A navigator extension that monitors user activity and gives a signal when the user has stopped using the navigator and can be turned off.

Parameters
platformContext
Context

Context.

model
Model

The model of the navigator whose status is being tracked.

speedBound
Double

Upper speed limit in m/s above which the navigator is considered to be active in the Finished state, i.e. driving continues.

timeThreshold
TimeInterval

Time during which in the Finished state of the navigator the speed is tracked below the threshold for determining the inactive state of the navigator. If during this time the speed is less than the set threshold or there is no location and speed data, the navigator is considered inactive.

Methods
Properties
StatefulChannel<Bool>

A flag whose active state indicates that the navigator must be stopped. If in the Finished state the navigation stops, i.e. the movement stops or its speed becomes lower than the threshold value, and if this state persists for some time, the flag is set to true, otherwise it is set to false.

A flag whose active state indicates that the navigator must be stopped. If in the Finished state the navigation stops, i.e. the movement stops or its speed becomes lower than the threshold value, and if this state persists for some time, the flag is set to true, otherwise it is set to false.