Nachdem Sie einen Nutzer mit einem Fahrer gekoppelt haben, müssen Sie das Ziel der Fahrt in der Fahrer-App konfigurieren. Gehen Sie dazu so vor:
Rufen Sie das Ziel des Fahrzeugs aus der Sammlung von Wegpunkten in Fleet Engine ab, die von GetTrip(), UpdateTrip() und GetVehicle() zurückgegeben wird.
Legen Sie das Ziel fest, indem Sie die Navigation SDK for iOS-Methode setDestinations() aufrufen.
Die folgenden Beispiele zeigen, wie Sie das Ziel in der Fahrer-App festlegen.
[null,null,["Zuletzt aktualisiert: 2025-08-31 (UTC)."],[[["\u003cp\u003eThis guide explains how to set a vehicle's destination in the driver app after a trip is matched.\u003c/p\u003e\n"],["\u003cp\u003eYou need to retrieve the destination waypoints from Fleet Engine's \u003ccode\u003eGetTrip()\u003c/code\u003e, \u003ccode\u003eUpdateTrip()\u003c/code\u003e, or \u003ccode\u003eGetVehicle()\u003c/code\u003e methods.\u003c/p\u003e\n"],["\u003cp\u003eUse the Navigation SDK for iOS \u003ccode\u003esetDestinations()\u003c/code\u003e method to set the destination in the driver app, ensuring coordinates match the trip's waypoint for proper consumer app rendering.\u003c/p\u003e\n"]]],[],null,["# Set the vehicle's destination\n\nThis section documents how to set the vehicle's destination after your server\nmatches a trip to a vehicle.\n\nBefore you begin\n----------------\n\nThis section requires you to have completed the following:\n\n- [Initialize the Driver SDK](/maps/documentation/mobility/driver-sdk/on-demand/ios/initialize-sdk)\n- [Get the vehicle ready](/maps/documentation/mobility/driver-sdk/on-demand/ios/vehicle-ready)\n- [Create a trip in Fleet Engine](/maps/documentation/mobility/fleet-engine/journeys/trips/create-trip)\n\nSet the destination in the driver app\n-------------------------------------\n\nAfter you have paired a consumer with a driver, you must configure the trip's\ndestination in the driver app by performing the following steps:\n\n1. Retrieve the vehicle's destination from its waypoints collection in Fleet\n Engine, which is returned by `GetTrip()`, `UpdateTrip()` and `GetVehicle()`.\n\n2. Set the destination by calling the Navigation SDK for iOS method\n [`setDestinations()`](/maps/documentation/navigation-sdk-ios/reference/interface_g_m_s_navigator#ae62d9db4071a0df6c3651b9675356df8).\n\n | **Note:** For the consumer app to properly render the trip, make sure the geographic latitude/longitude coordinates supplied to `setDestinations()` match those in the trip's waypoint. For more information, see the tutorial [Navigate a route](/maps/documentation/navigation/ios-sdk/route).\n\nThe following examples show how to set the destination in the driver\napp. \n\n### Swift\n\n private func startNavigation() {\n let destinations = [\n GMSNavigationWaypoint(\n placeID: \"ChIJnUYTpNASkFQR_gSty5kyoUk\", title: \"PCC Natural Market\"),\n GMSNavigationWaypoint(\n placeID: \"ChIJJ326ROcSkFQRBfUzOL2DSbo\", title: \"Marina Park\"),\n ]\n\n mapView.navigator?.setDestinations(destinations, callback: { routeStatus in\n guard routeStatus == .OK else {\n // Error starting navigation.\n return\n }\n mapView.locationSimulator?.simulateLocationsAlongExistingRoute()\n mapView.navigator?.isGuidanceActive = true\n mapView.navigator?.sendsBackgroundNotifications = true\n mapView.cameraMode = .following\n })\n }\n\n### Objective-C\n\n - (void)startNavigation {\n NSArray\u003cGMSNavigationWaypoint *\u003e *destinations =\n @[[[GMSNavigationWaypoint alloc] initWithPlaceID:@\"ChIJnUYTpNASkFQR_gSty5kyoUk\"\n title:@\"PCC Natural Market\"],\n [[GMSNavigationWaypoint alloc] initWithPlaceID:@\"ChIJJ326ROcSkFQRBfUzOL2DSbo\"\n title:@\"Marina Park\"]];\n\n [_mapView.navigator setDestinations:destinations\n callback:^(GMSRouteStatus routeStatus) {\n if (routeStatus != GMSRouteStatusOK) {\n // Error starting navigation.\n return;\n }\n [_mapView.locationSimulator simulateLocationsAlongExistingRoute];\n _mapView.navigator.guidanceActive = YES;\n _mapView.navigator.sendsBackgroundNotifications = YES;\n _mapView.cameraMode = GMSNavigationCameraModeFollowing;\n }];\n }"]]