CocoaPods¶
The CaptureSDK is released as a CocoaPods package.
iOS 13.0
(as of July 2024)The CaptureSDK for iOS supports both Swift and Objective C.
Take a look at this official guide to install or update CocoaPods on your machine before continuing.
Generating a Podfile¶
If your project already uses cocoapods, you can skip the following steps and move to the “Adding CaptureSDK to Podfile” section:
Open a terminal window and navigate to the directory of your project
Run this command in the terminal:
pod init
This will generate a new file called
Podfile
. Open this file by typingopen Podfile
in your terminal. (Or simply open from the Finder window)
Adding CaptureSDK to Podfile¶
Add this line to your Podfile:
pod 'CaptureSDK', '~> 1.9'
As our CaptureSDK is our private repository, it needs to specify the source of the CaptureSDK Cocoapods which is referenced internally. The content of the file should look like this:
source 'https://oauth2:[the-developer-portal-access-token]@sdk.socketmobile.com/capture/cocoapods-repo.git'
platform :ios, '13.0'
target 'MyApp'
pod 'CaptureSDK', '~> 1.9'
Note
The use_frameworks!
is no longer necessary as of CocoaPods version 1.5.0 and should be removed. Otherwise, multiple “double symbols” link warnings will be displayed when you run your application in Debug mode.
Installing the CaptureSDK¶
Once you have added the pod name to your Podfile, you will need to install the SDK.
Save your changes/additions to the Podfile. You can safely close it now.
Go back to your terminal window and run this command:
pod install
This will install the CaptureSDK within your project.
Once this completes, a new file will be generated called:
{Name_Of_Your_Project}.xcworkspace
If you had the
.xcodeproj
open during this time, please close it and open this newly created.xcworkspace
instead.