This section describes how to verify your system meets the minimum requirements, set up your Workspace Group, and get the Driver SDK.
Before you begin
The Driver SDK for iOS requires your app to meet the following criteria:
- Have the Navigation SDK.
- Enable the Maps SDK for iOS in your Google Cloud Console and get an API key.
Check the minimum system requirements
Check the release notes for the minimum requirements for the version of the Driver SDK you are using. See Release notes.
- The mobile device must be running iOS 14 or later.
- Apple Xcode version 15 or later.
Get access to your Google Workspace
If you are a Google Workspace customer, perform the following steps:
Create a Workspace Group. For more information, see Workspace Group.
For example, as a best practice, name your group
google-maps-platform-sdk-users@workspacedomain.com
during onboarding.Provide the name to Google to add your Workspace Group to an allowlist that grants access to the correct CocoaPods repositories.
Confirm that the user emails and service account emails that need access are included in this list.
If your organization cannot create Workspace Groups, send Google a list of user and service account emails that need access to these artifacts.
Sign in with the Cloud SDK
For local development, sign in with the Cloud SDK. For details, see Install the gcloud CLI.
The following examples show how to sign in with the Cloud SDK.
gcloud
gcloud auth login
You must use an email that is a member of the Workspace Group.
Set up your automation hosts
For build systems or continuous integration, set up your automation hosts based on the provided list of methods for using a service account to authenticate to Google APIs and services. For details, see the service account section in the Authentication methods at Google page.
If your process runs inside a Google Cloud environment, use automatic credential detection. For more information, see automatic credential detection.
Otherwise, store the service account key file in a secure location on the host's file-system and set the GOOGLE_APPLICATION_CREDENTIALS environment variable appropriately. For more details, see GOOGLE_APPLICATION_CREDENTIALS.
The service account email associated with the credentials must be a member of the Workspace Group.
Get the Driver SDK
Install and configure the Driver SDK.
CocoaPods
Install the CocoaPods tool: Open a terminal window and run the following command.
sudo gem install cocoapods
For more details, refer to the CocoaPods Get Started guide.
Create a Podfile for the Driver SDK: You use the Podfile to install the API and its dependencies.
Create a file named
Podfile
in your project directory. This file defines your project's dependencies.Edit the Podfile and add your dependencies. Here is an example which includes the dependencies:
source "https://github.com/CocoaPods/Specs.git" target 'YOUR_APPLICATION_TARGET_NAME_HERE' do pod 'GoogleRidesharingDriver' end
Here is an example which includes the Alpha and Beta pods for the Driver SDK as dependencies:
source "https://cpdc-eap.googlesource.com/ridesharing-driver-sdk.git" source "https://github.com/CocoaPods/Specs.git" target 'YOUR_APPLICATION_TARGET_NAME_HERE' do pod 'GoogleRidesharingDriver' end
Save the Podfile: Open a terminal and go to the folder with the Podfile:
cd <path-to-project>
Run the pod install command: This command will install the APIs specified in the Podfile, along with any dependencies they may have.
pod install
Open your project in Xcode: Close Xcode, and then open (double-click) your project's .xcworkspace file to launch Xcode. To open the project later, use the .xcworkspace file.
Swift Package Manager
The Driver SDK can be installed via Swift Package Manager. To add the SDK, ensure you have removed any existing Driver SDK dependencies.
To add the SDK to a new or existing project, follow these steps:
-
Open your Xcode
project
orworkspace
, then go to File > Add Package Dependencies. - Enter https://github.com/googlemaps/ios-driver-sdk as the URL, press Enter to pull in the package, and click "Add Package".
-
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".
To update the package
for an existing project, follow these steps:
- To verify your installation, go to the Package Dependencies section of Project Navigator to verify the package and its version.
To remove the existing Driver SDK installed manually, follow these steps:
From your Xcode project configuration settings, find Frameworks, Libraries, and Embedded Content. Use the minus sign
(-)
to remove the following framework:GoogleRidesharingDriver.xcframework
From the top level directory of your Xcode project, remove the
GoogleRidesharingDriver
bundle.
Manual installation
This guide shows how to manually add the XCFramework containing the Driver SDK to your project and configure your build settings in Xcode.
Before following this guide, do the following:
Download the XCFramework, a binary package that you use to install the Driver SDK. You can use this package on multiple platforms, including machines using Apple silicon
Install the Navigation SDK.
Perform the following steps to manually install the Driver SDK:
Download the SDK binary and resources:
Unpack the zipped files to access the XCFramework and resources.
Start Xcode and either open an existing or create a project. If you're new to iOS, create a new project and select the iOS App template.
If your project group does not contain a Frameworks group, create it.
To install the Driver SDK, drag the
GoogleRidesharingDriver.xcframework
file into your project under Frameworks, Libraries, and Embedded Content. If prompted, select Copy items.Drag the downloaded
GoogleRidesharingDriver.bundle
into the top-level directory of your Xcode project. If prompted, select Copy items.Select your project from the Project Navigator, and choose your application's target.
Open the Build Phases tab, and in Link Binary with Libraries, add the following frameworks and libraries if they are not already present:
Accelerate.framework
AudioToolbox.framework
AVFoundation.framework
CoreData.framework
CoreGraphics.framework
CoreLocation.framework
CoreTelephony.framework
CoreText.framework
GLKit.framework
ImageIO.framework
libc++.tbd
libxml2.tbd
libz.tbd
LocalAuthentication.framework
OpenGLES.framework
QuartzCore.framework
SystemConfiguration.framework
UIKit.framework
WebKit.framework
Choose your project, rather than a specific target, and open the Build Settings tab. In the Other Linker Flags section, add
-ObjC
for both debug and release.If these settings are not visible, change the filter in the Build Settings bar from Basic to All.
Inspect Apple Privacy Manifest File
Apple requires app privacy details for apps on the App Store. Visit the Apple App Store Privacy Details page 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 from the archive.