We have introduced new tracking modes in v3, with the following presets:
Passive
Active
Reactive
Custom
/*You can now start tracking your users. GeoSpark has three default trackingmodes.*/GeoSpark.startTracking(GeoSparkTrackingMode.passive)GeoSpark.startTracking(GeoSparkTrackingMode.active)GeoSpark.startTracking(GeoSparkTrackingMode.reactive)/* The SDK also provides a custom tracking mode that allows youto customize and build your own tracking mode.*/let trackingMethod = GeoSparkTrackingMethods.customtrackingMethod.activityType = .fitnesstrackingMethod.distanceFilter = 10trackingMethod.desiredAccuracy = .kCLLocationAccuracyBestGeoSpark.startTracking(.custom, options: trackingMethod)
Get online and offline active trips, using activeTrips()
method.
// Online TripGeoSpark.activeTrips(false) { (trips, error) in}// Offline TripGeoSpark.activeTrips(true) { (trips, error) in}
We have renamed endTrip to stopTrip.
GeoSpark.stopTrip("TRIPID") { (status, error) in}
To listen to events on the server-side, you need to enable geofence, trip, location and movingGeofence events for the user using the method below.
GeoSpark.toggleEvents(Geofence: BOOL, Trip: BOOL, Location: BOOL, MovingGeofence: BOOL) { (user, error) in}