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
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 instead.
- You need to share on-demand trip progress in an Android consumer app. Use Consumer SDK for Android instead.
- You need to share on-demand trip progress in a web app. Use JavaScript Consumer SDK 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 instead.
Consumer SDK for iOS: setup
- Authentication: JSON Web Token (JWT)
- Also enable: Fleet Engine Service
- Get started: Set up Consumer SDK for iOS
- Reference: Consumer SDK for iOS reference
- Policies: Consumer SDK for iOS policies
- Release notes: Consumer SDK for iOS release notes
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, Driver SDK for iOS, Driver SDK for Android, Maps SDK for iOS
Consumer SDK for iOS: common mistakes
- Problem: Trip monitoring fails with 401
UNAUTHENTICATEDwhen 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. - Problem: Trip monitoring fails with 400
INVALID_ARGUMENTwhen the trip name doesn't use the formatproviders/{provider_id}/trips/{trip_id}. Fix: Use the Google Cloud project ID asprovider_id, and pass the same project ID asproviderIDwhen you initialize the SDK. See /maps/documentation/mobility/journey-sharing/on-demand/ios/init-sdk. - Problem: The app keeps listening for updates after a trip is complete or canceled. Fix: Call
unregisterSubscriberon the trip model when the trip completes or is canceled. See /maps/documentation/mobility/journey-sharing/on-demand/ios/share-journey. - 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.bundleandGoogleRidesharingConsumer.bundleto the project, link the listed frameworks, and add-ObjCto Other Linker Flags for debug and release. See /maps/documentation/mobility/journey-sharing/on-demand/ios/setup.
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:withGMTSVehicleLocationOptions.[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.
- Add a customizable, interactive map that tracks the progress of a trip from Fleet Engine to a mobile app.
- Add a route polyline that tracks a trip from Fleet Engine to a map on a web page or mobile app.
- Update trip progress along a route in a map on a web page or mobile app for a Fleet Engine trip.
- Change the style of roads, polylines, and polygons on a map that tracks the progress of a trip from Fleet Engine.
- Display or hide map features on a map that tracks the progress of a trip from Fleet Engine.
- Change the style of icons and text labels on a map that tracks the progress of a trip from Fleet Engine.
- Apply different map styles to different zoom levels on a map that tracks the progress of a trip from Fleet Engine.
- Change the density of places on a map that tracks the progress of a trip from Fleet Engine. 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. 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. 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.
- Customize the route polyline on a map that tracks the progress of a trip from Fleet Engine.