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-01-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-29 UTC."],[[["Setting `locationTrackingEnabled` to `false` disables location updates and takes the vehicle offline when the driver ends their shift."],["Disabling location updates automatically sets the vehicle state to `GMTDVehicleState.offline` in Fleet Engine."],["Refer to the `updateVehicleState` documentation for handling potential failures when disabling location updates."]]],[]]