Enable AR in your iOS app

Enable ARCore in your iOS projects.

Prerequisites

ARCore requires a deployment target of 11.0 or higher.

Install the ARCore SDK for iOS

You must build your app with iOS SDK version 15.0 or higher. The SDK can be installed using either CocoaPods or the Swift Package Manager (currently in beta).

Use CocoaPods

Specify the ARCore SDK for iOS in your Podfile to integrate it into your Xcode project:

target 'YOUR_APPLICATION_TARGET_NAME_HERE'
platform :ios, '11.0'
pod 'ARCore/SUBSPEC_NAME_HERE' ~> VERSION_HERE

Run the following command to install it:

$ pod install

Use Swift Package Manager (beta)

ARCore can be integrated as a local package using the Swift Package Manager. To install the ARCore SDK for iOS using the Swift Package Manager:

  1. Download and unzip the pod bundle (ARCore-$VERSION.tar.gz).
  2. Either go to File > Add Packages and click Add Local or drag the folder into your project to add the directory as a local package.
  3. After package resolution, go to Build Phases > Link Binary With Libraries and add the appropriate component libraries of ARCore as dependencies of your app.
  4. Add the flag -ObjC to Other Linker Flags. It is recommended to set Other Linker Flags to $(inherited) -ObjC.
  5. Make sure that the Enable Modules and Link Frameworks Automatically build settings are set to Yes, because ARCore relies on auto-linking.
  6. Make sure that Enable Bitcode is set to No, because ARCore binaries do not contain bitcode.
  7. Import ARCore. This is necessary for auto-linking to find the required system frameworks and libraries.
    • Objective-C: Use either #import or @import.
    • Swift: Use import.

Create a Google Cloud project and enable the ARCore API

Before you can start using the ARCore Cloud Anchor API or the ARCore Geospatial API, you must first enable the ARCore API in a new or existing Google Cloud Platform project.

You must enable the ARCore API in your Google Cloud Project. If you need to create the project, do the following:

  1. Visit Create a project in Google Cloud Platform.

  2. Enter an appropriate Project name, and choose a location for it.

  3. Click Create.

  4. In the sidebar, select APIs & Services, then Library.

  5. Search for the ARCore API, select it, and click Enable.

Comply with the User Privacy Requirements

Make sure that your app complies with ARCore's User Privacy Requirements.

Next steps