- Developers
- Sygic Mobile Telematics SDK
- iOS Library
- Getters and statistics
Getters and statistics
Introduction
Documentation is provided through Swift.
Get trips
Retrieve all user trips based on the time windows provided
SygicDriving.sharedInstance().serverApi.UserTrips(
withStart: date1, end: date2, page: 0, pageSize: 100,
completionBlock: { (containerWithTrips, error) in
      guard error == nil else {
          return
      }
      if let containerWithTrips = containerWithTrips {
          for trip in containerWithTrips.trips {
               print("\(trip.startDate)")
          }
      }
 })Get trip detail
Retrieve the full detail of a particular trip
SygicDriving.sharedInstance().serverApi.UserTripDetail (tripId: tripId) { (tripModel, error) in
    ...
}  Get live user statistics
Retrieve user statistics. Currently we define: last 7 days, last 30 days and lifetime
SygicDriving.sharedInstance().serverApi.LiveStats 
{ (stats: [SygicStats], error) in
    ...
}Get monthly statistics
Retrieve user statistics based on a defined month range
SygicDriving.sharedInstance().serverApi.MonthlyStats(fromMonth: 1, fromYear: 2019, toMonth: 12, toYear: 2019)
{ (stats: [SygicStats], error) in
      ...
}