Disable location updates
Stay organized with collections
Save and categorize content based on your preferences.
When the driver finishes their shift, you can disable location updates and take
the vehicle offline by setting locationTrackingEnabled
to false
.
Disabling location updates also sends a final vehicle update request to Fleet
Engine to set the vehicle state to GMTDVehicleState.offline
.
For special considerations on handling failures when disabling location updates,
see
updateVehicleState
.
Swift
vehicleReporter.locationTrackingEnabled = false
Objective-C
_vehicleReporter.locationTrackingEnabled = NO;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-03 UTC.
[null,null,["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eSetting \u003ccode\u003elocationTrackingEnabled\u003c/code\u003e to \u003ccode\u003efalse\u003c/code\u003e disables location updates and takes the vehicle offline when the driver ends their shift.\u003c/p\u003e\n"],["\u003cp\u003eDisabling location updates automatically sets the vehicle state to \u003ccode\u003eGMTDVehicleState.offline\u003c/code\u003e in Fleet Engine.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the \u003ccode\u003eupdateVehicleState\u003c/code\u003e documentation for handling potential failures when disabling location updates.\u003c/p\u003e\n"]]],[],null,["# Disable location updates\n\nWhen the driver finishes their shift, you can disable location updates and take\nthe vehicle offline by setting `locationTrackingEnabled` to `false`.\n\nDisabling location updates also sends a final vehicle update request to Fleet\nEngine to set the vehicle state to `GMTDVehicleState.offline`.\n\nFor special considerations on handling failures when disabling location updates,\nsee\n[`updateVehicleState`](/maps/documentation/mobility/driver-sdk/on-demand/reference/ios/interface_g_m_t_d_vehicle_reporter). \n\n### Swift\n\n vehicleReporter.locationTrackingEnabled = false\n\n### Objective-C\n\n _vehicleReporter.locationTrackingEnabled = NO;"]]