כדי להתחיל לשלוח עדכונים לגבי כלי רכב ל-Fleet Engine ולעורף הלקוח, צריך ליצור מופע GMTDDeliveryDriverAPI שכולל את providerID, vehicleID, driverContext ו-accessTokenProvider.
הערך providerID זהה למזהה הפרויקט של הפרויקט ב-Google Cloud. מידע על הגדרת הפרויקט ב-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];
}