หากต้องการเริ่มแชร์การเดินทางจาก Fleet Engine และแบ็กเอนด์ของลูกค้า คุณต้องเริ่มต้นใช้งาน Consumer SDK ในแอปพลิเคชัน iOS
providerID เหมือนกับรหัสโปรเจ็กต์ของโปรเจ็กต์ Google Cloud
 ดูข้อมูลเกี่ยวกับการตั้งค่าโปรเจ็กต์ Google Cloud ได้ที่
สร้างโปรเจ็กต์ Fleet Engine
ตัวอย่างต่อไปนี้แสดงวิธีเริ่มต้น SDK สำหรับผู้บริโภคในแอป
Swift
/*
 * AppDelegate.swift
 */
import GoogleRidesharingConsumer
import GoogleMaps
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  func application(_ application: UIApplication,
      didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // Register your API key for GMSServices.
    GMSServices.provideAPIKey(yourMapsAPIKey)
    // Set the instance of the SampleAccessTokenProvider.
    GMTCServices.setAccessTokenProvider(SampleAccessTokenProvider(), providerID: yourProviderID)
    // Other initialization code ...
    return true
  }
}
Objective-C
/*
 * AppDelegate.m
 */
#import <GoogleMaps/GoogleMaps.h>
#import <GoogleRidesharingConsumer/GoogleRidesharingConsumer.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  //Register your API key for GMSServices.
  [GMSServices provideAPIKey:yourMapsAPIKey];
  //Set the instance of the AccessTokenFactory.
  [GMTCServices setAccessTokenProvider:[[SampleAccessTokenProvider alloc] init]
                            providerID:yourProviderID];
  // Other initialization code ...
  return YES;
}
@end