Google Cloud コンソール プロジェクトを構成する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Driver SDK 用にモバイルアプリ プロジェクトと Google Cloud コンソール プロジェクトを構成する手順は次のとおりです。
- モビリティ プロジェクト用の Google Cloud コンソール開発プロジェクトと API キーがない場合は、設定する必要があります。詳細については、Fleet Engine プロジェクトを作成するをご覧ください。
- Google Cloud コンソールで、Fleet Engine で使用しているのと同じ Google Cloud コンソール プロジェクトと API キーを選択します。
- [API とサービス] を選択し、[マップ] でフィルタして、Maps SDK for iOS を検索して有効にします。
API キーをプロジェクトに追加する
次の例は、Xcode でプロジェクトに API キーを追加する方法を示しています。
Swift
次のように、API キーを AppDelegate.swift
に追加します。
次の import ステートメントを追加します。
import GoogleMaps
import GoogleRidesharingDriver
application(_:didFinishLaunchingWithOptions:)
メソッドに以下を追加します。
GMSServices.provideAPIKey("YOUR_API_KEY")
Objective-C
次のように、API キーを AppDelegate.m
に追加します。
次の import ステートメントを追加します。
@import GoogleMaps;
@import GoogleGoogleRidesharingDriver;
application:didFinishLaunchingWithOptions:
メソッドに以下を追加します。
[GMSServices provideAPIKey:@"YOUR_API_KEY"];
次のステップ
認証トークンを作成する
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-31 UTC。
[null,null,["最終更新日 2025-08-31 UTC。"],[[["\u003cp\u003eTo 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.\u003c/p\u003e\n"],["\u003cp\u003eEnsure 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.\u003c/p\u003e\n"],["\u003cp\u003eIntegrate your API key into your Xcode project by adding it to \u003ccode\u003eAppDelegate\u003c/code\u003e and utilizing necessary import statements (\u003ccode\u003eGoogleMaps\u003c/code\u003e, \u003ccode\u003eGoogleRidesharingDriver\u003c/code\u003e).\u003c/p\u003e\n"]]],[],null,["# Configure a Google Cloud console project\n\nTo configure your mobile app project and Google Cloud console project for the Driver\nSDK, follow these steps:\n\n1. 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](/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet/create-project).\n2. In the Google Cloud console, select the same Google Cloud console project and API key that you are using for Fleet Engine.\n3. Select **APIs \\& Services** , filter by **Maps**, and then search for and enable the Maps SDK for iOS.\n\nAdd your API key to the project\n-------------------------------\n\nThe following examples show how to add the API key to your project in Xcode: \n\n### Swift\n\nAdd your API key to your `AppDelegate.swift` as follows:\n\n1. Add the following import statements:\n\n import GoogleMaps\n import GoogleRidesharingDriver\n\n2. Add the following to your `application(_:didFinishLaunchingWithOptions:)`\n method:\n\n GMSServices.provideAPIKey(\"\u003cvar translate=\"no\"\u003eYOUR_API_KEY\u003c/var\u003e\")\n\n### Objective-C\n\nAdd your API key to your `AppDelegate.m` as follows:\n\n1. Add the following import statements:\n\n @import GoogleMaps;\n @import GoogleGoogleRidesharingDriver;\n\n2. Add the following to your `application:didFinishLaunchingWithOptions:`\n method:\n\n [GMSServices provideAPIKey:@\"\u003cvar translate=\"no\"\u003eYOUR_API_KEY\u003c/var\u003e\"];\n\nWhat's next\n-----------\n\n[Create authentication tokens](/maps/documentation/mobility/driver-sdk/on-demand/ios/authenticate)"]]