Getting Started

Learn how to add the OpenWeb SDK to your iOS app.

The OpenWeb iOS SDK empowers you to create an in-app user experience that fuels quality interactions with community and content, enabling users to make engaging and valuable contributions.

Specifically, the iOS SDK offers the following benefits:

  • Simple, straightforward API with the flexibility to use UIViews over just UIViewControllers
  • Comprehensive error states, report reasons, and a clarity mode for reliable app development
  • Robust, stable SDK foundation, supported by performance enhancements like background threading
  • New design preset options to seamlessly integrate the user experience with your brand's aesthetic
  • Stunning shimmering skeletons while loading data


Prerequisites

ItemDescription
iOS 12.0 or lateriOS device operating system
OpenWeb AccountContact your PSM for more information
Xcode Apple's integrated development environment



Add the iOS SDK

To add a Conversation to your app, you must import the OpenWeb iOS SDK and then configure your project.

You can add the iOS SDK using either Cocoapods or Swift Package Manager.


Using Cocoapods

Follow these steps to add the iOS SDK:

  1. In a text editor, open Podfile.

  2. Add pod 'OpenWebSDK', '<<iOSVersion>>.

    target 'OpenWeb-SDK-iOS-Demo' do
      use_frameworks!
    
      # Pod for OpenWeb-SDK
      pod 'OpenWebSDK', '<<iOSVersion>>'
    end
    
    # Setting `BUILD_LIBRARY_FOR_DISTRIBUTION` to `YES` in the host application for Rx dependencies.
    # This step is required for `OpenWebSDK.xcframework` to find symbols of the Rx dependencies at runtime.
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          if target.name == "RxSwift" || target.name == "RxCocoa" || target.name == "RxRelay"
            config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
          end
        end
      end
    end
    
  3. In Terminal, at the terminal prompt of your project directory, execute pod install to install the dependencies added to Podfile.

    ❗️

    The post_install is required.

    Without changing the BUILD_LIBRARY_FOR_DISTRIBUTION flag of the Rx dependencies, the application will crash as soon as it boots up.

  4. Open the .xcworkspace file for your project to launch Xcode.



Using Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the Swift compiler.

Follow these steps to add the iOS SDK:

  1. Add openweb-ios-sdk-pod.git as a dependency of your Package.swift.
    dependencies: [
        .package(url: "https://github.com/SpotIM/openweb-ios-sdk-pod.git", .upToNextMajor(from: "<<iOSVersion>>"))
    ]
    
  2. Open the .xcodeproj file for your project to launch Xcode.


Import the OpenWebSDK

Follow the step to import the library:

  1. In any .swift file using the OpenWeb SDK, import the SDK.
    import OpenWebSDK
    


Next Step