Add iOS SDK to your app

Add the SDK

Using Cocoapods

  1. In a text editor, open Podfile.
  2. Add pod 'CommentSystem'
target 'CommentSystem' do
  # Use one of those options
  use_frameworks!
  # use_frameworks! :linkage => :static

  # Pods for CommentSystem
  pod 'CommentSystem'
end
  1. In terminal go to your project directory then execute pod install --repo-update to install the dependencies added to Podfile.
  2. Open the .xcworkspace file for your project to launch Xcode.

Initialize Sdk the Comment System SDK

  1. In Xcode, open AppDelegate.swift
  2. Import the CommentSystem iOS SDK: import CommentSystem
  3. Initialize the SDK in application(application:didFinishLaunchingWithOptions). Make sure to replace SITE_ID, URL , NAME, PAGE_TITLE, THREAD_ID and THREAD_PROFILE_ID with the values corresponding to your domain.
import CommentSystem

func application(_ application: UIApplication, 
                                didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]?) -> Bool { 
    ArenaCommentSystem(
            ContextFactory(),
            SITE_ID,
            URL,
            NAME,
            PAGE_TITLE,
            THREAD_ID,
            THREAD_PROFILE_ID,
            Environment.DEVELOPMENT
    )
    return true
}