Visit

data class Visit(visitId: String? = null, venue: Venue?, type: LocationType = LocationType.UNKNOWN, val arrival: Long = 0, confidence: Confidence = Confidence.NONE, var location: FoursquareLocation, val wifi: String?, otherPossibleVenues: List<Venue> = emptyList(), stopDetectionAlgorithm: StopDetectionAlgorithm? = null, segments: List<Segment> = emptyList(), stateProvider: String?, departure: Long = 0, sentArrivalTrigger: Boolean = false) : Parcelable

This is the main entity of the Movement SDK. It encapsulates all of the information about the users visit.

Constructors

Link copied to clipboard
fun Visit()
Link copied to clipboard
fun Visit(visitId: String? = null, venue: Venue?, type: LocationType = LocationType.UNKNOWN, arrival: Long = 0, confidence: Confidence = Confidence.NONE, location: FoursquareLocation, wifi: String?, otherPossibleVenues: List<Venue> = emptyList(), stopDetectionAlgorithm: StopDetectionAlgorithm? = null, segments: List<Segment> = emptyList(), stateProvider: String?, departure: Long = 0, sentArrivalTrigger: Boolean = false)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Gets the type of visit that this is. LocationType.VENUE if its a normal visit, LocationType.HOME or LocationType.WORK when at home / work, or LocationType.NONE if it is a blank visit generated by a network communication error.

Link copied to clipboard
fun getVenue(): Venue?

The venue object for the Foursquare location the device is at. Will be null if the device is in LocationType.NONE and may be null if the device is at LocationType.HOME, LocationType.WORK depending on your settings in the online Movement SDK console.

Link copied to clipboard

Gets the visit id for the current visit. This will be null if this visit was unable to communicate with the Foursquare servers when it was created, for example in cases of no network connectivity. To match up a visit without a visit id and a backfill visit notification, you can match on the timestamp from .getArrival

Link copied to clipboard

Gets whether or not the device has left this place

Properties

Link copied to clipboard
@SerializedName(value = "arrival")
val arrival: Long = 0

Gets the timestamp in milliseconds that the device arrived at this visit.

Link copied to clipboard
@SerializedName(value = "location")
var location: FoursquareLocation

Gets the location that this visit was created at. Note that this does not correspond directly to the center of the Venue that the visit occurred at but to the location that the user was at when the Movement SDK detected that they were at that place. If you want the actual venue location, you can get that from Venue.location

Link copied to clipboard

Gets the amount of time in milliseconds that the device was at this visit.

Link copied to clipboard
@SerializedName(value = "wifi")
val wifi: String?