The Consumer SDK for iOS lets iOS consumer apps follow on-demand trips in Fleet Engine. Its classes, such as `GMTCTripModel` and `GMTCJourneySharingSession`, model trip data and show the vehicle's location, route, ETA, and remaining distance on a map.

## Consumer SDK for iOS: key facts

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

## Consumer SDK for iOS: when to use it

**Use Consumer SDK for iOS when:**

- You need an iOS app where consumers follow an on-demand ride or delivery trip that Fleet Engine tracks.
- You need to show a vehicle's near real-time location, route, and live traffic on a map in an iOS consumer app.
- You need to show pickup and drop-off ETA and remaining distance for an on-demand trip in iOS.
- You already use Fleet Engine and the Driver SDK for on-demand trips and need the consumer side of journey sharing.
**Don't use Consumer SDK for iOS when:**

- You need consumers to follow scheduled tasks or shipments; the scheduled-tasks consumer experience is documented for JavaScript. Use [JavaScript Consumer SDK](https://developers.google.com/maps/documentation/mobility/journey-sharing/quick-reference-js.md.txt) instead.
- You need to share on-demand trip progress in an Android consumer app. Use [Consumer SDK for Android](https://developers.google.com/maps/documentation/mobility/journey-sharing/quick-reference-android.md.txt) instead.
- You need to share on-demand trip progress in a web app. Use [JavaScript Consumer SDK](https://developers.google.com/maps/documentation/mobility/journey-sharing/quick-reference-js.md.txt) instead.
- You need to send the driver's location and trip state from the driver's iOS app to Fleet Engine. Use [Driver SDK for iOS](https://developers.google.com/maps/documentation/mobility/driver-sdk/quick-reference-ios.md.txt) instead.

## Consumer SDK for iOS: setup

- **Authentication:** JSON Web Token (JWT)
- **Also enable:** [Fleet Engine Service](https://developers.google.com/maps/documentation/mobility/fleet-engine/quick-reference.md.txt)
- **Get started:** [Set up Consumer SDK for iOS](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/setup.md.txt)
- **Reference:** [Consumer SDK for iOS reference](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes.md.txt)
- **Policies:** [Consumer SDK for iOS policies](https://developers.google.com/maps/documentation/mobility/services/terms.md.txt)
- **Release notes:** [Consumer SDK for iOS release notes](https://developers.google.com/maps/documentation/mobility/services/resources/relnotes_consumer_sdk_ios.md.txt)

**Official Consumer SDK for iOS packages:**

- cocoapods: `GoogleRidesharingConsumer`
- swift_package: `https://github.com/googlemaps/ios-consumer-sdk`

## Consumer SDK for iOS: related products

- **Often used with:** [Fleet Engine Service](https://developers.google.com/maps/documentation/mobility/fleet-engine/quick-reference.md.txt), [Driver SDK for iOS](https://developers.google.com/maps/documentation/mobility/driver-sdk/quick-reference-ios.md.txt), [Driver SDK for Android](https://developers.google.com/maps/documentation/mobility/driver-sdk/quick-reference-android.md.txt), [Maps SDK for iOS](https://developers.google.com/maps/documentation/ios-sdk/quick-reference.md.txt)

## Consumer SDK for iOS: common mistakes

- **Problem:** Trip monitoring fails with 401 `UNAUTHENTICATED` when the JWT is signed without a trip ID or has expired. **Fix:** Have your token provider (`GMTCAuthorization`) return a JWT issued for the trip ID in the authorization context, cache it per trip, and refresh it when it expires. See [/maps/documentation/mobility/journey-sharing/on-demand/ios/auth-sdk](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/auth-sdk.md.txt).
- **Problem:** Trip monitoring fails with 400 `INVALID_ARGUMENT` when the trip name doesn't use the format `providers/{provider_id}/trips/{trip_id}`. **Fix:** Use the Google Cloud project ID as `provider_id`, and pass the same project ID as `providerID` when you initialize the SDK. See [/maps/documentation/mobility/journey-sharing/on-demand/ios/init-sdk](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/init-sdk.md.txt).
- **Problem:** The app keeps listening for updates after a trip is complete or canceled. **Fix:** Call `unregisterSubscriber` on the trip model when the trip completes or is canceled. See [/maps/documentation/mobility/journey-sharing/on-demand/ios/share-journey](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/share-journey.md.txt).
- **Problem:** Manual XCFramework installs omit required resource bundles and build settings unless you add them in Xcode. **Fix:** Use CocoaPods where you can. For manual installs, add `gRPCCertificates.bundle` and `GoogleRidesharingConsumer.bundle` to the project, link the listed frameworks, and add `-ObjC` to Other Linker Flags for debug and release. See [/maps/documentation/mobility/journey-sharing/on-demand/ios/setup](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/setup.md.txt).

## Consumer SDK for iOS: legacy and deprecated features

- **`GMTSVehicleLocation` `-initWithLatLng:latLngAccuracy:heading:headingAccuracy:speed:speedAccuracy:updateTime:isSnappableToRoute:` initializer:** Deprecated since 2025-06-01. **Replacement:** `GMTSVehicleLocation` `-initWithOptions:` with `GMTSVehicleLocationOptions`.
- **`[GMTCMapView initWithCoder]`:** Deprecated since 2023-12-01. **Replacement:** `GMTCMapView` `-initWithOptions:`.

## What you can do with Consumer 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).

- [Add a customizable, interactive map that tracks the progress of a trip from Fleet Engine to a mobile app.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/create-ui.md.txt)
- [Add a route polyline that tracks a trip from Fleet Engine to a map on a web page or mobile app.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/customize-polylines.md.txt#polylines)
- [Update trip progress along a route in a map on a web page or mobile app for a Fleet Engine trip.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/share-journey.md.txt#update)
- [Change the style of roads, polylines, and polygons on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/style.md.txt#cbms)
- [Display or hide map features on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/style.md.txt#cbms)
- [Change the style of icons and text labels on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/style.md.txt#cbms)
- [Apply different map styles to different zoom levels on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/style.md.txt#cbms)
- [Change the density of places on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/style.md.txt#cbms) Experimental **Note:** Cloud-based Maps Styling support in the Consumer SDK is GA, while POI density control is an Experimental Cloud-based Maps Styling feature (supported on light map styles only).
- [Change the style of buildings on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/style.md.txt#cbms) Experimental **Note:** Cloud-based Maps Styling support in the Consumer SDK is GA, while 3D and footprint building style customization is an Experimental Cloud-based Maps Styling feature (supported on light map styles only).
- [Change the style of landmarks on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/style.md.txt#cbms) Experimental **Note:** Cloud-based Maps Styling support in the Consumer SDK is GA, while landmark icon customization is an Experimental Cloud-based Maps Styling feature (supported on light map styles only).
- [Customize a marker on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/customize-markers.md.txt)
- [Customize the route polyline on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/ios/customize-polylines.md.txt)