उपभोक्ता SDK टूल शुरू करें

Fleet Engine और ग्राहक के बैकएंड से गतिविधियां शेयर करने के लिए, आपको अपने iOS ऐप्लिकेशन में उपभोक्ता SDK शुरू करना होगा.

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

आगे क्या करना है

मैप सेट अप करना