# GMTDVehicleReporter

    @interface GMTDVehicleReporter
        : NSObject <GMSNavigatorListener, GMSRoadSnappedLocationProviderListener>

Object for sending information to the Fleet Engine backend.

Use this class only from the main thread.
- `


  ### [-init](https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Classes/GMTDVehicleReporter#/c:objc(cs)GMTDVehicleReporter(im)init)


  ` Unavailable
  This class has no public initializers; obtain this object from the `vehicleReporter` property
  of the `https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Classes/GMTDDeliveryDriverAPI.html` or `GMTDRidesharingDriverAPI` object.

  #### Declaration

  Objective-C

      - (null_unspecified instancetype)init;

- `


  ### [locationTrackingEnabled](https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Classes/GMTDVehicleReporter#/c:objc(cs)GMTDVehicleReporter(py)locationTrackingEnabled)


  ` Indicates whether location tracking is enabled.

  If set to YES, trip and vehicle updates are sent to the Fleet Engine backend at a regular
  interval based on the value set for `locationUpdateInterval`. Note: Once location tracking is
  enabled again, the vehicle state will remain `OFFLINE` unless `updateVehicleState` is called.

  If set to NO, updates stop and a one-off vehicle update request is sent to the Fleet Engine
  backend to set the vehicle state to `GMTDVehicleStateOffline`. See
  `updateVehicleState` for special considerations on handling failures when
  `locationTrackingEnabled` is set to NO.

  #### Declaration

  Swift

      var locationTrackingEnabled: Bool { get set }

  Objective-C

      @property (nonatomic) BOOL locationTrackingEnabled;

- `


  ### [locationReportingInterval](https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Classes/GMTDVehicleReporter#/c:objc(cs)GMTDVehicleReporter(py)locationReportingInterval)


  ` Indicates the minimum interval at which location reports will be delivered to Fleet Engine.

  NOTE: The default reporting interval is 10 seconds. The maximum supported value is 60 seconds
  and the minimum supported value is 5 seconds. If a value outside of this range is used, the
  requested value is clamped to that range.

  #### Declaration

  Swift

      var locationReportingInterval: TimeInterval { get set }

  Objective-C

      @property (nonatomic) NSTimeInterval locationReportingInterval;

- `


  ### [-updateVehicleState:](https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Classes/GMTDVehicleReporter#/c:objc(cs)GMTDVehicleReporter(im)updateVehicleState:)


  ` Updates the vehicle state. Used only for ridesharing.

  If `https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Classes/GMTDVehicleReporter.html#/c:objc(cs)GMTDVehicleReporter(py)locationTrackingEnabled` is set to NO, setting the state to `GMTDVehicleStateOnline` fails.

  Setting a different state will send a one-off request to the Fleet Engine backend.

  This method updates a server-side state, the client app should monitor
  `-fleetEngine:didSucceedVehicleUpdate:` and `-fleetEngine:didFailVehicleUpdate:withError:`
  to confirm success or failure. Failures are retried automatically if
  `https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Classes/GMTDVehicleReporter.html#/c:objc(cs)GMTDVehicleReporter(py)locationTrackingEnabled` is set to YES.

  #### Declaration

  Swift

      func update(_ vehicleState: https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Enums/GMTDVehicleState.html)

  Objective-C

      - (void)updateVehicleState:(https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Enums/GMTDVehicleState.html)vehicleState;

  #### Parameters

  |---|---|
  | ` vehicleState ` | The desired vehicle state. |

- `


  ### [-addListener:](https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Classes/GMTDVehicleReporter#/c:objc(cs)GMTDVehicleReporter(im)addListener:)


  ` Adds a listener. The listener is held with a weak reference.

  #### Declaration

  Swift

      func add(_ listener: any https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Protocols/GMTDVehicleReporterListener.html)

  Objective-C

      - (void)addListener:(nonnull id<https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Protocols/GMTDVehicleReporterListener.html>)listener;

  #### Parameters

  |---|---|
  | ` listener ` | An object conforming to the `https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Protocols/GMTDVehicleReporterListener.html` protocol. |

- `


  ### [-removeListener:](https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Classes/GMTDVehicleReporter#/c:objc(cs)GMTDVehicleReporter(im)removeListener:)


  ` Removes a listener.

  #### Declaration

  Swift

      func remove(_ listener: any https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Protocols/GMTDVehicleReporterListener.html)

  Objective-C

      - (void)removeListener:(nonnull id<https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Protocols/GMTDVehicleReporterListener.html>)listener;

  #### Parameters

  |---|---|
  | ` listener ` | An object conforming to the `https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/reference/ios/Protocols/GMTDVehicleReporterListener.html` protocol. |