AFLocation

class AFLocation(val latitude: Double, val longitude: Double, val accuracyMeters: Double?, val timestampMillis: Long, val isFresh: Boolean)

Snapshot of the device's location captured by the SDK's location ping.

The ping fires once per AFCore.initialize() when location permission has already been granted. The SDK first attempts a fresh GPS fix; on timeout or provider failure it falls back to the platform's last-known location. Either way the result is persisted and retrievable via AFCore.getLastKnownLocation().

Use isFresh to distinguish a just-acquired fix from an older cached one, and ageMillis to decide whether the cached value is still useful for your UI.

Constructors

Link copied to clipboard
constructor(latitude: Double, longitude: Double, accuracyMeters: Double?, timestampMillis: Long, isFresh: Boolean)

Properties

Link copied to clipboard

Estimated horizontal accuracy of the fix in meters, or null if the platform did not report one. Smaller is better; values above ~100m usually indicate a coarse / cell-tower fix.

Link copied to clipboard

Age of timestampMillis relative to the current wall clock, in milliseconds. Computed on each read so a stored fallback location keeps ageing as time passes.

Link copied to clipboard

true when the value came from a current-location request completed within the SDK's timeout. false when the SDK fell back to the platform's last-known location (no fresh fix available in time).

Link copied to clipboard

Decimal degrees (WGS-84).

Link copied to clipboard

Decimal degrees (WGS-84).

Link copied to clipboard

When the fix was acquired by the platform, in milliseconds since the Unix epoch. For isFresh = true this is roughly now; for last-known fallbacks it can be hours or days old (see ageMillis).

Functions

Link copied to clipboard
open override fun toString(): String