Consumer SDK for iOS quick reference

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

Official Consumer SDK for iOS packages:

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

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.
  • 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.
  • 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.
  • 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.

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.