Configure a Google Cloud console project

  • To use the Driver SDK, you must first set up a Google Cloud console project and an API key for your mobility project if you haven't already.

  • Ensure the same Google Cloud project and API key used for Fleet Engine are selected, and enable the Maps SDK for iOS within the APIs & Services section.

  • Integrate your API key into your Xcode project by adding it to AppDelegate and utilizing necessary import statements (GoogleMaps, GoogleRidesharingDriver).

To configure your mobile app project and Google Cloud console project for the Driver SDK, follow these steps:

  1. If you don't have a Google Cloud console development project and an API key for your mobility project, you need to set one up. For more information, see Create your Fleet Engine project.
  2. In the Google Cloud console, select the same Google Cloud console project and API key that you are using for Fleet Engine.
  3. Select APIs & Services, filter by Maps, and then search for and enable the Maps SDK for iOS.

Add your API key to the project

The following examples show how to add the API key to your project in Xcode:

Swift

Add your API key to your AppDelegate.swift as follows:

  1. Add the following import statements:

    import GoogleMaps
    import GoogleRidesharingDriver
    
  2. Add the following to your application(_:didFinishLaunchingWithOptions:) method:

    GMSServices.provideAPIKey("YOUR_API_KEY")
    

Objective-C

Add your API key to your AppDelegate.m as follows:

  1. Add the following import statements:

    @import GoogleMaps;
    @import GoogleGoogleRidesharingDriver;
    
  2. Add the following to your application:didFinishLaunchingWithOptions: method:

    [GMSServices provideAPIKey:@"YOUR_API_KEY"];
    

What's next

Create authentication tokens