Add iOS SDK to your app


Add the SDK

Using Cocoapods

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

  # Pods for ArenaChat
  pod 'ArenaChat'
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 Arena Chat SDK

  1. In Xcode, open AppDelegate.swift
  2. Import the ArenaChat iOS SDK: import ArenaChat
  3. Initialize the SDK in application(application:didFinishLaunchingWithOptions). Make sure to replace SITE_ID, ROOM_ID with the values corresponding to your domain.
import ArenaChat

func application(_ application: UIApplication, 
                                didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]?) -> Bool { 
    ArenaChat(
            ContextFactory(),
            SITE_ID,
            ROOM_ID,
            Environment.DEVELOPMENT
    )
    return true
}