iOS SDK Integration Document
iOS SDK Integration Guide
This document provides a comprehensive guide to integrate the Spyne iOS SDK into your project. The SDK supports different methods for Catalog Shoot and Spin-360 Shoot.
Catalog Shoot vs Spin-360 Shoot
- Catalog Shoot: Includes shooting experiences for Exterior Images, Interior Images, and Miscellaneous Images.
- Spin-360 Shoot: Includes shooting experiences for Exterior Video, Ricoh Theta Integration, Interior Images, and Miscellaneous Images.
Note: Currently, Exterior Spin-360 can only be generated via video.
Steps to Integrate the Framework
Step 1: Import the Framework File into the Frameworks Group
Import the framework file into the Frameworks group of your Xcode project.
Step 2: Add Embed and Sign-In Settings
Ensure to add the Embed and Sign-In settings into your project target’s general settings.
Step 3: Install Required Dependencies Using CocoaPods
Install the following pods to your project:
pod 'Moya'
pod 'SwiftyGif'
pod 'IQKeyboardManagerSwift'
pod "KRProgressHUD"
pod 'SDWebImage'
pod 'SwiftMessages'
pod 'NVActivityIndicatorView'
pod "PostHog", "~> 1.1"
pod 'RealmSwift'
pod 'FYVideoCompressor'
pod 'lottie-ios'
pod 'OpalImagePicker'
pod 'Toast-Swift'
pod 'TagListView'
pod "ViewAnimator"
pod 'THETAClient'
pod 'Amplitude'
pod 'AWSS3', '~> 2.36.7'
pod 'AmplifyPlugins/AWSCognitoAuthPlugin', '~> 1.31.0'
Steps to Start Image/Video Shoot
Step 1: Initialize the SDK in AppDelegate
- The
awsconfiguration
andamplifyconfiguration
files will be shared with you via email or call. - Add these files to your project’s root directory.
Step 2: Import the Required SDKs
Import the necessary SDKs in your view controller class:
import SpyneAutomobile
Step 3: Implement the SpyneAutomobileDelegate
Protocol
SpyneAutomobileDelegate
ProtocolYou will receive various callbacks when images or videos are clicked/recorded during the shoot.
- Callback when the first image/video is clicked or recorded (for 360 Spin Shoot).
- Callback when the user exits the image/360 Spin shoot.
- Callback when the shoot is completed. You can distinguish between Catalog Shoot and 360 Spin Shoot via the
type
parameter:- imageShoot: For catalog shoot.
- video360: For 360 spin shoot.
Step 3.1: Start Image Shoot
To start an image shoot, call the startImageShoot
method:
func startImageShoot(apiKey: String, backgroundID: String, backgroundImageUrl: String, backgroundType: String)
- The
api_key
,backgroundID
,backgroundImageUrl
, andbackgroundType
will be shared with you over the call. - When the image shoot flow starts, on completion, you will receive a callback containing Spyne’s
skuId
, which you can use to access processed images via our Get API or set up a Webhook for you.
func onShootCompleted(skuId: String, type: SpyneAutomobile.ShootType, completeProject: String?)
Step 3.2: Resume Pending Image Upload
If the app was closed or the user exited the shoot mid-way, you can resume pending image uploads by invoking this method on app start.
Step 3.3: Start Video Shoot
To start the 360 spin shoot, use the startVideoShoot
method:
func startVideoShoot(apiKey: String, backgroundID: String, backgroundImageUrl: String, backgroundType: String)
- Similar to image shoot, the
api_key
,backgroundID
,backgroundImageUrl
, andbackgroundType
will be shared with you over call. - Upon completion, you will receive a callback containing the Spyne
skuId
, which you can use to access processed images.
func onShootCompleted(skuId: String, type: SpyneAutomobile.ShootType, completeProject: String?)
Step 3.4: Resume Pending Video Upload
If the app was closed or interrupted during video shoot, invoke this function on app start to resume pending video uploads.
Updated 29 days ago
Please look for SDK React to Swift Bridge documentation in case your app is built on React Native