After you enable billing and create an API key, set up the Xcode project that
you use to develop your app.

[Release notes](https://developers.google.com/maps/documentation/ios-sdk/releases) are available for each
release.

## Step 1: Install the required software

To build a project using the Maps SDK for iOS, download and install:

- [Xcode](https://developer.apple.com/xcode/) **version 26.0** or later

## Step 2: Create the Xcode project and install the Maps SDK for iOS

> [!NOTE]
> **Note:** The Maps SDK for iOS adds an average IPA size of 5.7 MB for apps made for specific devices. The download size for universal apps may be larger.

The SDK install size varies. For example, the
install size for Maps SDK for iOS version 9.0 is about 18 MB.

> [!NOTE]
> **Note:** With version 9.2.0, GoogleMapsCore and GoogleMapsBase are consolidated into the GoogleMaps XCFramework. No additional setup is required.

> [!CAUTION]
> The Maps SDK for iOS does not currently support Mergeable Libraries. To avoid linker failures during release builds, ensure that the **Build Mergeable Library** setting in your Xcode project is set to **No** (the default).

### Swift Package Manager


The Maps SDK for iOS can be installed via [Swift Package Manager](https://developer.apple.com/documentation/xcode/swift-packages). To add the SDK, ensure you have
removed any existing Maps SDK for iOS dependencies.


To add the SDK to a new or existing project, follow these steps:

1. Open your Xcode `project` or `workspace`, then go to **File \> Add Package Dependencies**.
2. Enter <https://github.com/googlemaps/ios-maps-sdk> as the URL, press **Enter** to pull in the package, and click "Add Package".
3. To install a specific `version`, set the **Dependency Rule** field to one of the version-based options. For new projects, we recommend specifying the latest version and using the "Exact Version" option. Once complete, click "Add Package".
4. From the **Choose Package Products** window, verify `GoogleMaps` (for versions earlier than 9.0.0, verify `GoogleMaps`, `GoogleMapsBase`, and `GoogleMapsCore`) will be added to your designated `main` target. Once complete, click "Add Package".
5. To verify your installation, navigate to your target's **General** pane. In the **Frameworks, Libraries, and Embedded Content** you should see the installed packages. You can also view the "Package Dependencies" section of "Project Navigator" to verify the package and its version.

To update the `package` for an existing project, follow these steps:

1. **If you are upgrading from a version earlier than 9.0.0,** you must remove
   the following dependencies: `GoogleMapsBase`, `GoogleMapsCore`, and
   `GoogleMapsM4B` after upgrading. Do not remove the dependency for
   `GoogleMaps`. For more information, see the
   [Version 9.0.0 Release Notes](https://developers.google.com/maps/documentation/ios-sdk/release-notes-archive.md.txt#May_20_2024).

   From your Xcode project configuration settings, find **Frameworks, Libraries,
   and Embedded Content** . Use the **minus sign(-)** to remove the following framework:
   - `GoogleMapsBase` (Only for upgrades from versions earlier than 9.0.0)
   - `GoogleMapsCore` (Only for upgrades from versions earlier than 9.0.0)
   - `GoogleMapsM4B` (Only for upgrades from versions earlier than 9.0.0)
2. From Xcode, go to **File \> Packages \> Update To Latest Package Versions**.
3. To verify your installation, go to the **Package Dependencies** section of **Project Navigator** to verify the package and its version.

**Important:** Sometimes, artifacts cannot be resolved or errors can occur, in this case select "File \> Packages \> Reset Package Cache".

<br />


To remove existing Maps SDK for iOS dependencies added using
`CocoaPods`, follow these steps:

1. Close your Xcode workspace. Open terminal and execute the following command:

   ```swift
   sudo gem install cocoapods-deintegrate cocoapods-clean
   pod deintegrate
   pod cache clean --all
   ```
2. Remove the `Podfile`, `Podfile.resolved` and the Xcode `workspace` if you are not using them for anything other than CocoaPods.

To remove existing Maps SDK for iOS installed manually, follow these steps:

<!-- -->

1. From your Xcode project configuration settings, find **Frameworks, Libraries,
   and Embedded Content** . Use the **minus sign (-)** to remove the following framework:
   - `GoogleMaps`
   - `GoogleMapsBase` (Only for installations earlier than version 9.2.0)
   - `GoogleMapsCore` (Only for installations earlier than version 9.2.0)
   - `GoogleMapsM4B` (Only for installations earlier than version 9.0.0)
2. From the top level directory of your Xcode project, remove the `GoogleMaps` bundle.

### Manual Installation

This guide describes how to manually add the XCFrameworks containing the Maps SDK for iOS to your project and configure your build settings in Xcode. An XCFramework is a binary package that you use on multiple platforms, including machines using [Apple silicon](https://support.apple.com/en-us/HT211814).

1. Download the following SDK binaries and resource files:
   - [GoogleMaps](https://dl.google.com/geosdk/swiftpm/11.3.0/GoogleMaps_3p.xcframework.zip)
   - [GoogleMapsResources](https://dl.google.com/geosdk/swiftpm/11.3.0/GoogleMapsResources.zip)
2. Extract the files to access the XCFrameworks and resources.
3. If you don't have an Xcode project yet, create one now and save it to your local machine. If you're new to iOS development:
   1. Create a new project.
   2. Select the **iOS \> App** template.
   3. On the project options screen:
      1. Enter the **Project Name**.
      2. Record the value of the **Bundle identifier** field. You can use that value to restrict your API key below.
      3. Set the project **Interface** to **Storyboard**.
      4. Set the **Language** to **Swift** or **Objective-C**.
4. Open the **General** tab. Drag the following XCFrameworks into your project under **Frameworks, Libraries, and Embedded Content** . Make sure to select **Do Not Embed** :
   - `GoogleMaps.xcframework`
5. Copy the `GoogleMaps.bundle` from the **GoogleMapsResources** you downloaded into your Xcode project's top level directory. Make sure to select **Copy items into destination group's folder** when prompted.
6. Select your project from the Project Navigator, and choose your application's target.
7. Open the **Build Phases** tab for your application's target. Within **Link Binary with Libraries** , add the following frameworks and libraries:
   - `Accelerate.framework`
   - `Contacts.framework`
   - `CoreData.framework`
   - `CoreGraphics.framework`
   - `CoreImage.framework`
   - `CoreLocation.framework`
   - `CoreTelephony.framework`
   - `CoreText.framework`
   - `GLKit.framework`
   - `ImageIO.framework`
   - `libc++.tbd`
   - `libz.tbd`
   - `Metal.framework`
   - `MetricKit.framework`
   - `OpenGLES.framework` (Only if you are using OpenGL)
   - `QuartzCore.framework`
   - `Security.framework`
   - `SystemConfiguration.framework`
   - `UIKit.framework`
8.
   Choose your project, rather than a specific target, and open the
   **Build Settings** tab. In the **Linking - General -\> Other Linker
   Flags** section, add `-ObjC` to "Debug" and "Release". If these
   settings aren't visible, change the filter in the **Build Settings** bar
   from **Basic** to **All**.

9. To install the Places SDK for iOS XCFramework, see
   [Get Started
   with the Places SDK for iOS](https://developers.google.com/maps/documentation/places/ios-sdk/start#step-2-install-the-api).

## Step 3: Add your API key to the project

In [Get an API key](https://developers.google.com/maps/documentation/ios-sdk/get-api-key.md.txt#add_key), you
generated an API key for your app. Now add that key to your Xcode project.

In the following examples, replace `YOUR_API_KEY` with your API key.

> [!NOTE]
> **Note:** If you recorded the **Bundle identifier** of your project, or obtained it from the project properties, use it to restrict your API key for use only with iOS applications with that specific bundle identifier. See [Restricting API keys](https://developers.google.com/maps/documentation/ios-sdk/get-api-key.md.txt#restrict_key) for more information.

### Swift

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

1. Add the following import statement:

   ```swift
   import GoogleMaps
   ```
2. Add the following to your `application(_:didFinishLaunchingWithOptions:)` method, using your API key:

   ```swift
   GMSServices.provideAPIKey("YOUR_API_KEY")
   ```
3. If you are also using the Places API, add your key again as shown here:

   ```swift
   GMSPlacesClient.provideAPIKey("YOUR_API_KEY")
   ```

### Objective-C

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

1. Add the following import statement:

   ```objective-c
   @import GoogleMaps;
   ```
2. Add the following to your `application:didFinishLaunchingWithOptions:` method, using your API key:

   ```objective-c
   [GMSServices provideAPIKey:@"YOUR_API_KEY"];
   ```
3. If you are also using the Places API, add your key again as shown here:

   ```objective-c
   [GMSPlacesClient provideAPIKey:@"YOUR_API_KEY"];
   ```

## Step 4 (optional): Inspect Apple Privacy Manifest file

> [!NOTE]
> **Note:** The following is relevant when you deploy your app to the web store.

Apple requires app privacy details for apps on the App Store. Visit the [Apple App Store Privacy Details page](https://developers.google.com/maps/documentation/ios-sdk/apple-privacy-policy.md.txt) for updates and more information.

The Apple Privacy Manifest file is included in the resources bundle for the SDK. To verify that the Privacy Manifest File has been included, and to inspect its contents, create an archive of your app and [generate a privacy report](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests#4239187) from the archive.

## Step 5 (optional): Declare the URL schemes used by the API

Beginning with iOS 9 and Xcode 7, apps declare the URL schemes that they
intend to open by specifying the schemes in the app's `Info.plist` file. The
Maps SDK for iOS opens the Google Maps mobile app when the user clicks
the Google logo on the map, and your app can therefore declare the relevant URL
schemes.

To declare the URL schemes used by the Maps SDK for iOS, add the
following lines to your `Info.plist`:

     <key>LSApplicationQueriesSchemes</key>
     <array>
            <string>googlechromes</string>
            <string>comgooglemaps</string>
        </array>

The following image shows the configuration in the Xcode user interface:

![Configuration of `LSApplicationQueriesSchemes` in Xcode](https://developers.google.com/static/maps/documentation/ios-sdk/images/LSApplicationQueriesSchemes.png)

Without the above declaration, the following errors can occur when the user taps
the Google logo on the map:

- `-canOpenURL: failed for URL: "comgooglemaps://" - error: "This app is not
  allowed to query for scheme comgooglemaps"`
- `-canOpenURL: failed for URL: "googlechromes://" - error: "This app is not
  allowed to query for scheme googlechromes"`

To eliminate these errors, add the declaration to your `Info.plist`.

## What's next

Now that you have an API key and an Xcode project, create and run apps.
The Navigation SDK for iOS provides many tutorials and sample apps that help you
get started. For more details, see:

- [Add a Map with a
  Marker](https://developers.google.com/maps/documentation/ios-sdk/map-with-marker).
- [Select Current Place and Show Details on a
  Map](https://developers.google.com/maps/documentation/ios-sdk/current-place-tutorial).
- [Reverse Geocoding](https://developers.google.com/maps/documentation/ios-sdk/reverse_geocoding.md.txt).
- Check out the available [code samples](https://developers.google.com/maps/documentation/ios-sdk/examples.md.txt) and [codelabs](https://codelabs.developers.google.com/?cat=mapsplatform).
- For end-to-end solutions, review the available [Maps Solutions](https://developers.google.com/maps/solutions).