The Driver SDK for iOS is a mobile app toolkit and a component of Fleet Engine. It sends a driver app's vehicle location, route, waypoints, remaining distance, and ETA from the Navigation SDK to Fleet Engine, for on-demand trips and scheduled tasks.

## Driver SDK for iOS: key facts

- **Product:** Driver SDK for iOS
- **Also known as:** Driver SDK, Driver SDK for on-demand trips, Driver SDK for scheduled tasks
- **Category:** Routes
- **Platform:** iOS
- **Runs on:** Client (app or browser code)
- **Launch stage:** GA
- **Lifecycle:** Active
- **Overview:** [Driver SDK for iOS overview](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand.md.txt)

## Driver SDK for iOS: when to use it

**Use Driver SDK for iOS when:**

- You need an iOS driver app to send real-time vehicle location updates to Fleet Engine.
- You need to report the route, waypoints, remaining distance, and ETA from the Navigation SDK to Fleet Engine.
- You need drivers to manage assigned on-demand trips and navigate in one app without switching apps.
- You're building a driver app for Fleet Engine scheduled tasks on iOS.
**Don't use Driver SDK for iOS when:**

- You only need turn-by-turn navigation in your iOS app, without Fleet Engine tracking. Use [Navigation SDK for iOS](https://developers.google.com/maps/documentation/navigation/ios-sdk/quick-reference.md.txt) instead.
- You need to show trip or delivery progress to the rider or customer in a consumer app. Use [Consumer SDK for iOS](https://developers.google.com/maps/documentation/mobility/journey-sharing/quick-reference-ios.md.txt) instead.
- You need to send vehicle data updates other than location and route; these go through your backend to Fleet Engine. Use [Fleet Engine Service](https://developers.google.com/maps/documentation/mobility/fleet-engine/quick-reference.md.txt) instead.
- Your driver app runs on Android. Use [Driver SDK for Android](https://developers.google.com/maps/documentation/mobility/driver-sdk/quick-reference-android.md.txt) instead.

## Driver SDK for iOS: setup

- **Authentication:** API key, JSON Web Token (JWT)
- **Also enable:** [Maps SDK for iOS](https://developers.google.com/maps/documentation/ios-sdk/quick-reference.md.txt)
- **Get started:** [Set up Driver SDK for iOS](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand/ios/minimum-requirements.md.txt)
- **Reference:** [Driver SDK for iOS reference](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand/reference/ios/Classes.md.txt)
- **Policies:** [Driver SDK for iOS policies](https://developers.google.com/maps/documentation/mobility/services/terms.md.txt)
- **Release notes:** [Driver SDK for iOS release notes](https://developers.google.com/maps/documentation/mobility/services/resources/relnotes_driver_sdk_ios.md.txt)

**Official Driver SDK for iOS packages:**

- cocoapods: `GoogleRidesharingDriver`
- swift_package: `https://github.com/googlemaps/ios-driver-sdk`

## Driver SDK for iOS: related products

- **Often used with:** [Navigation SDK for iOS](https://developers.google.com/maps/documentation/navigation/ios-sdk/quick-reference.md.txt), [Fleet Engine Service](https://developers.google.com/maps/documentation/mobility/fleet-engine/quick-reference.md.txt), [Consumer SDK for iOS](https://developers.google.com/maps/documentation/mobility/journey-sharing/quick-reference-ios.md.txt)

## Driver SDK for iOS: common mistakes

- **Problem:** The first vehicle update after startup can fail with 'update_mask cannot be empty' when the `updateMask` parameter is empty. **Fix:** Always provide at least one field name in `updateMask`, and handle this error in `GMTDVehicleReporterListener` `didFailVehicleUpdate`. See [/maps/documentation/mobility/driver-sdk/on-demand/ios/troubleshoot](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand/ios/troubleshoot.md.txt).
- **Problem:** `GMSRoadSnappedLocationProvider` doesn't keep sending location updates when the device hasn't moved since the last update, for example when a driver waits idle. **Fix:** To send a new location update while the device is stationary, stop and then start `GMSRoadSnappedLocationProvider` (with `GMTDVehicleReporter` already added as its listener). See [/maps/documentation/mobility/driver-sdk/on-demand/ios/vehicle-ready](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand/ios/vehicle-ready.md.txt).
- **Problem:** The consumer app doesn't render the trip correctly if the coordinates passed to `setDestinations()` don't match the trip's waypoint. **Fix:** Make sure the latitude/longitude passed to `setDestinations()` match the trip waypoint coordinates in Fleet Engine. See [/maps/documentation/mobility/driver-sdk/on-demand/ios/trip-details](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand/ios/trip-details.md.txt).
- **Problem:** Using an optimistic version operator (`~>`) can lead to unpredictable, unrepeatable builds, and omitting a version loads the newest SDK, which can include breaking changes or raise the minimum iOS version. Carthage isn't supported. **Fix:** Pin an exact Driver SDK version in CocoaPods or Swift Package Manager, and check the release notes before upgrading. See [/maps/documentation/mobility/driver-sdk/on-demand/ios/versions](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand/ios/versions.md.txt).

## Driver SDK for iOS: legacy and deprecated features

- **`GMTSVehicleMatch` class:** Deprecated. **Replacement:** No replacement needed in Driver SDK (vehicle matching is handled in Fleet Engine). **Symptom:** Deprecated in Driver SDK for iOS v2.2.0 and omitted from the current Driver SDK reference. See the [migration guide](https://developers.google.com/maps/documentation/mobility/services/resources/relnotes_driver_sdk_ios.md.txt#v220_january_2023).
- **`GMTSServiceType` and `fetchAuthTokenForServiceType:authorizationContext:completion:`:** Deprecated since 2021-11-29. **Replacement:** `GMTDAuthorization` `fetchTokenWithContext:completion:` with `GMTDAuthorizationContext` (claims for vehicle ID only). See the [migration guide](https://developers.google.com/maps/documentation/mobility/services/resources/relnotes_driver_sdk_ios.md.txt#v10_november_29_2021).

## What you can do with Driver SDK for iOS

See the guides linked below for each task, or compare across products in the
[Capabilities Explorer](https://developers.google.com/maps/documentation/capabilities-explorer.md.txt).

- [Report a vehicle's real-time position to the Fleet Engine service.](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand/ios/vehicle-ready.md.txt)
- [Report the latitude/longitude coordinates of a vehicle's trip waypoints from the Navigation SDK to the Fleet Engine service.](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand/ios/trip-details.md.txt#set_the_destination_in_the_driver_app)
- [Report a vehicle's remaining distance to its next waypoint to the Fleet Engine service.](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand.md.txt#what-can-you-do)
- [Report a vehicle's estimated time of arrival at its next waypoint to the Fleet Engine service.](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand.md.txt#what-can-you-do)
- [Report the route provided for a vehicle by the Navigation SDK to the Fleet Engine service.](https://developers.google.com/maps/documentation/mobility/driver-sdk/on-demand/ios/trip-details.md.txt#set_the_destination_in_the_driver_app)