Install the iOS SDK

To get started, install the SDK and then update some of the properties in your project.

Install the Frameworks 

You can install the SDK using CocoaPods, or you can download and install the frameworks manually.

Install with CocoaPods 

If you haven’t already done so, install the CocoaPods gem, and initialize the CocoaPods main repository.

CocoaPods Setup
1sudo gem install cocoapods
2pod setup

If you already have CocoaPods installed, update your pods to the latest version.

CocoaPods Update
1pod update

To create a Podfile, change to the root directory of your application project. Then create or edit the file named Podfile.

Add the following lines to your project’s Podfile. The Agentforce SDK podspec will pull in additional dependencies as needed.

At the top of your Podfile, add the Salesforce Mobile iOS Spec Repo above the CocoaPods trunk repo. Make sure to add the CocoaPods CDN if you use any other CocoaPods dependencies.

Podfile Sources
1source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git'
2source 'https://github.com/livekit/podspecs.git'
3source 'https://cdn.cocoapods.org/'

Then, in your target, add:

Podfile Target Dependencies
1pod 'AgentforceSDK'
2pod 'Messaging-InApp-Core', '> 1.10.0'
3pod 'LiveKitClient' # Required to ensure CocoaPods looks in the correct source location

At the bottom of your podfile where you set up your post installer, configure it as shown:

Podfile Post Install
1post_install do |installer|
2  installer.pods_project.targets.each do |target|
3    target.build_configurations.each do |config|
4      config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
5    end
6  end
7end

After adding the pods, run pod install from your project’s root directory. If CocoaPods is unable to locate the specs, try pod install --repo-update.

Dependencies 

The AgentforceSDK includes the following key dependencies:

  • AgentforceMobileService-iOS: The API layer for Agentforce.
  • SalesforceNetwork: An interface for consuming applications to provide a networking layer to Agentforce Mobile SDK.
  • SalesforceNavigation: An interface for consuming applications to handle navigation events occurring within Agentforce Mobile SDK views.
  • SalesforceUser: A designated way to provide user information to Agentforce Mobile SDK.
  • SalesforceLogging: An interface for consuming applications to handle logging from within Agentforce Mobile SDK.
  • Swift-Markdown-UI: A rendering library for GitHub Flavored Markdown.

Next Steps