API キーをまだお持ちでない場合は、手順に沿って Google Cloud コンソールでプロジェクトを設定し、API キーを取得します。Cloud コンソールで鍵を構成するときに、サンプルアプリのバンドル ID に鍵を制限して、アプリのみが鍵を使用できるようにします。SDK サンプルアプリのデフォルトのバンドル ID は com.example.GoogleMapsDemos です。
Swift の場合は SDKConstants.swift ファイルを、Objective-C の場合は SDKDemoAPIKey.h ファイルを編集し、apiKey 定数または kAPIKey 定数の定義に API キーを貼り付けます。次に例を示します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-11 UTC。"],[[["The Maps SDK for iOS provides a sample app with code examples showcasing key features, serving as a starting point for your iOS app development."],["You can find a comprehensive list of samples in the GitHub repository and easily access specific feature implementations through provided links."],["To run the full sample app locally, clone the repository, install dependencies using CocoaPods, and build the project in Xcode after configuring your API key."],["Troubleshooting steps are available if you encounter issues like not seeing a map after successfully running the app, guiding you to add your API key correctly."]]],["The provided content focuses on using the Maps SDK for iOS. Key actions include cloning the sample app repository from GitHub, building the app in Xcode, and integrating an API key. The API key is obtained from the Google Cloud console. After entering the API key, you can build and run the project. You then can interact with the various features demonstrated, like displaying a basic map, adding markers, drawing shapes, enabling location, and handling events. Finally, the content mentions the necessity to grant the app location access.\n"]]