Consumer SDK চালু করা

Fleet Engine এবং গ্রাহক ব্যাকএন্ড থেকে যাত্রা শেয়ার করা শুরু করতে, আপনাকে iOS অ্যাপ্লিকেশনে Consumer SDK শুরু করতে হবে।

providerID হল আপনার Google Cloud প্রোজেক্টের প্রোজেক্ট আইডি-এর মতোই। Google Cloud প্রোজেক্ট সেট-আপ করার ব্যাপারে তথ্য পেতে, আপনার Fleet Engine প্রোজেক্ট তৈরি করুন দেখুন।

আপনার অ্যাপে কীভাবে Consumer 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

এরপর কী

ম্যাপ সেট-আপ করা