Adding the Talk SDK

You can add the Talk SDK to your project using one of the following methods:

The Talk SDK requires microphone access for making a voice call. Whatever method you choose to add the SDK, also check the usage descriptions in the Info.plist file for microphone access.

Adding the SDK using CocoaPods

CocoaPods is a dependency manager that lets you add third-party frameworks and libraries to projects. For installation instructions, see Install CocoaPods.

If not already done, create a Podfile for your project as follows:

  1. In Terminal, navigate to the top-level folder of your project (the one with the xcodeproj file).
  2. Create a Podfile using the pod init command.
  3. Add the ZendeskTalkSDK pod to your Podfile.

    target 'My Sample App' do    pod 'ZendeskTalkSDK'end

    Note: If you're using Objective-C, you'll need to include use_frameworks!.

  4. Run the pod install command.
  5. Create a new "Run Scripts Phase" in your target's "Build Phases".

    This script should be the last step in your project's "Build Phases". Paste the following snippet into the script text field:

    "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/TalkSDK.framework/strip-frameworks.sh"

    This step is required to work around an App store submission bug when archiving universal binaries. Please ensure your project's VALID_ARCHS build setting does not contain i386 or x86_64 for release configuration.

Because your project now contains a dependency managed by CocoaPods, you must open the project in Xcode by double-clicking the .xcworkspace file, not .xcodeproj.

For more information, see Using CocoaPods on cocoapods.org.

Adding the SDK using Carthage

Carthage is a third-party dependency manager for iOS applications. For installation and usage instructions, see Installing Carthage in the Carthage readme on Github.

  1. Add the following lines to your Cartfile to import the necessary frameworks for working with the UI we provide:

    # The main Talk SDK frameworksbinary "https://raw.githubusercontent.com/zendesk/talk_sdk_ios/release/ZendeskTalkSDK.json" == 1.1.0
    # Shared Zendesk frameworksbinary "https://zendesk.jfrog.io/zendesk/libs-releases-local/ios/zendesk/ZendeskCoreSDK/ZendeskCoreSDK.json" == 2.4.1
    # Twilio librarybinary "https://raw.githubusercontent.com/twilio/twilio-voice-ios/Releases/twilio-voice-ios.json" == 5.3.1
  2. Run the carthage update command.
  3. On your target's General tab, drag each of the following frameworks from the Carthage/Build/iOS folder to the Frameworks, Libraries and Embedded Content section and embed the frameworks by selecting Embed & Sign option:

    • TalkSDK.framework
    • ZendeskCoreSDK.framework
    • TwilioVoice.framework

    Note: Your app's build targets must point the FRAMEWORK_SEARCH_PATHS setting to the Carthage/Build/iOS folder.

  4. Create a new "Run Scripts Phase" in your app target's "Build Phases".

    This script should be the last step in your project's "Build Phases".

    Paste the following snippet into the script text field:

    "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/TalkSDK.framework/strip-frameworks.sh"

    This step is required to work around an App store submission bug when archiving universal binaries. Please ensure your project's VALID_ARCHS build setting does not contain i386 or x86_64 for release configuration.

Adding the SDK manually

  1. Download the ZIP files from the Zendesk Talk SDK repo and from the Zendesk Core SDK repo on Github and unzip the files on your hard drive.
  2. In Xcode, select your project in Project navigator:

  3. In Finder, navigate to where you extracted the SDKs.
  4. Drag the following items into the Embedded Binaries section of your project.

    • TalkSDK.framework
    • ZendeskCoreSDK.framework
  5. Set the Add Files options as follows:

    • Destination - select Copy items if needed
    • Added folders - select Create groups
  6. Create a new "Run Scripts Phase" in your app's target's "Build Phases".

    This script should be the last step in your projects "Build Phases". Paste the following snippet into the script text field:

    bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/TalkSDK.framework/strip-frameworks.sh"
  7. Follow manual installation instruction for Twilio as described in the Twilio docs.

    This step is required to work around an App store submission bug when archiving universal binaries. Pltease ensure your project's VALID_ARCHS build setting does not contain i386 or x86_64 for release configuration.