Para começar a compartilhar trajetos do Fleet Engine e do back-end do cliente, é necessário inicializar o SDK do consumidor no seu aplicativo iOS.
O providerID é o mesmo que o ID do projeto do seu projeto do Google Cloud. Para informações sobre como configurar o projeto do Google Cloud, consulte
Criar seu projeto do Fleet Engine.
Os exemplos a seguir mostram como inicializar o SDK Consumer no seu app.
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