iOS SDK

Requirements

  • ARCloud project from Graffity Console
  • iOS 14.0+
  • Xcode 12.0+
  • iOS Device to run AR app - ARCloud requires a camera, so the iOS simulator doesn't support it.

See more about iOS adaptation at https://developer.apple.com/support/app-store/ (opens in a new tab)

Setup AR Cloud Project

Before you set up SDK for iOS, please create your project with Graffity Console. You will be guild to generate an ACCESS_TOKEN that used to init our SDK.

Setup Xcode Project

Step 1 - Install the Graffity AR Cloud SDK for iOS

Our SDK comes in a standard swift package with no Pods required. Simply add this repository to your Xcode project. Select File > Add Packages and enter its repository URL.

https://github.com/Graffity-Technologies/graffity-arcloud-ios.git

iOS

iOS 2

Step 2: Init services with Access Token

import GraffityARCloudService
 
let graffityARCloud = GraffityARCloud(accessToken: "YOUR_ACCESS_TOKEN")

Step 3: Add an AR Cloud view to your app

The example code below shows how to add an ARCloud view to UIKit and SwiftUI. You may also implement it in any way you prefer but make sure the way you present the ARCloud view does not block UITapGestureRecognizer functionalities.

Step 4: Finally, add a permission request for your iOS app

Add camera & location description to Info.plist

Info.plist
<key>NSLocationWhenInUseUsageDescription</key>
<string>App needs a location to start AR session accurately</string>
<key>NSCameraUsageDescription</key>
<string>App needs a camera to enable AR scanning</string>

Step 5 (Optional): Additional configs for AR Cloud services

Please go to iOS options page below to deep dive for more options like onTap each AR node.

iOS Options

Run your project

  1. Connect an iPhone to your computer
  2. Make sure USB Debugging is enabled for your phone
  3. Hit the run button in Xcode
  4. Scan around to let service determine your position in the real world.

Report Issues

If you're facing any issues related to this package, please find out here.