드라이버 SDK 초기화
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Fleet Engine 및 고객 백엔드에 차량 업데이트를 전송하기 시작하려면 providerID
, vehicleID
, driverContext
, accessTokenProvider
이 포함된 GMTDDeliveryDriverAPI
인스턴스를 만듭니다.
providerID
는 Google Cloud 프로젝트의 프로젝트 ID와 동일합니다. Google Cloud 프로젝트 설정에 관한 자세한 내용은 Fleet Engine 프로젝트 만들기를 참고하세요.
다음 예에서는 GMTDDeliveryDriverAPI
인스턴스를 만드는 방법을 보여줍니다.
Objective-C
#import "SampleViewController.h"
#import "SampleAccessTokenProvider.h"
#import <GoogleRidesharingDriver/GoogleRidesharingDriver.h>
static NSString *const PROVIDER_ID = @"INSERT_YOUR_PROVIDER_ID";
@implementation SampleViewController {
GMSMapView *_mapView;
}
- (void)viewDidLoad {
NSString *vehicleID = @"INSERT_CREATED_VEHICLE_ID";
SampleAccessTokenProvider *accessTokenProvider =
[[SampleAccessTokenProvider alloc] init];
GMTDDriverContext *driverContext =
[[GMTDDriverContext alloc] initWithAccessTokenProvider:accessTokenProvider
providerID:PROVIDER_ID
vehicleID:vehicleID
navigator:_mapView.navigator];
GMTDDeliveryDriverAPI *deliveryDriverAPI = [[GMTDDeliveryDriverAPI alloc] initWithDriverContext:driverContext];
}
다음 단계
차량 준비하기
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-31(UTC)
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eTo initiate vehicle updates to Fleet Engine and the customer backend, create a \u003ccode\u003eGMTDDeliveryDriverAPI\u003c/code\u003e instance.\u003c/p\u003e\n"],["\u003cp\u003eThis instance requires your Google Cloud Project ID (\u003ccode\u003eproviderID\u003c/code\u003e), \u003ccode\u003evehicleID\u003c/code\u003e, \u003ccode\u003edriverContext\u003c/code\u003e, and \u003ccode\u003eaccessTokenProvider\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAn Objective-C code example demonstrates the creation of a \u003ccode\u003eGMTDDeliveryDriverAPI\u003c/code\u003e instance using these parameters.\u003c/p\u003e\n"],["\u003cp\u003eFor setup instructions of your Google Cloud Project, refer to the provided documentation link.\u003c/p\u003e\n"],["\u003cp\u003eThe next step involves getting the vehicle ready, as detailed in the provided link.\u003c/p\u003e\n"]]],[],null,["# Initialize the Driver SDK\n\nTo start sending vehicle updates to Fleet Engine and the customer backend,\ncreate a `GMTDDeliveryDriverAPI` instance that includes the\n`providerID`, `vehicleID`, `driverContext`, and `accessTokenProvider`.\n\nThe `providerID` is the same as the **Project ID** of your Google Cloud\nProject. For information on setting up the Google Cloud Project, see\n[Create your Fleet Engine project](/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet/create-project).\n\nThe following example shows how to create a `GMTDDeliveryDriverAPI` instance. \n\n### Objective-C\n\n #import \"SampleViewController.h\"\n #import \"SampleAccessTokenProvider.h\"\n #import \u003cGoogleRidesharingDriver/GoogleRidesharingDriver.h\u003e\n\n static NSString *const PROVIDER_ID = @\"INSERT_YOUR_PROVIDER_ID\";\n\n @implementation SampleViewController {\n GMSMapView *_mapView;\n }\n\n - (void)viewDidLoad {\n NSString *vehicleID = @\"INSERT_CREATED_VEHICLE_ID\";\n SampleAccessTokenProvider *accessTokenProvider =\n [[SampleAccessTokenProvider alloc] init];\n GMTDDriverContext *driverContext =\n [[GMTDDriverContext alloc] initWithAccessTokenProvider:accessTokenProvider\n providerID:PROVIDER_ID\n vehicleID:vehicleID\n navigator:_mapView.navigator];\n\n GMTDDeliveryDriverAPI *deliveryDriverAPI = [[GMTDDeliveryDriverAPI alloc] initWithDriverContext:driverContext];\n }\n\nWhat's next\n-----------\n\n[Get the vehicle ready](/maps/documentation/mobility/driver-sdk/scheduled/ios/vehicle-ready)"]]