Skip to content

cometchat/calls-sdk-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

CometChat

CometChat iOS Calls SDK

CometChat enables you to add voice, video & text chat for your website & app.


Prerequisites ⭐

Before you begin, ensure you have met the following requirements:

✅   You have installed the latest version of Xcode. (Above Xcode 12 Recommended)

✅   iOS Calls SDK works for iOS devices from iOS 11 and above.


Installing iOS Chat SDK

1. Setup 🔧

To install iOS Call SDK, you need to first register on CometChat Dashboard. Click here to sign up.

i. Get your Application Keys 🔑

  • Create a new app
  • Head over to the Quick Start or API & Auth Keys section and note the App ID, Auth Key, and Region.

ii. Add the CometChatCallsSDK Dependency

We recommend using CocoaPods, as they are the most advanced way of managing iOS project dependencies. Open a terminal window, move to your project directory, and then create a Podfile by running the following command

Create podfile using below command.

$ pod init

Add the following lines to the Podfile.

________________________________________________________________

For Xcode 12 and above:

platform :ios, '11.0'
use_frameworks!

target 'YourApp' do
     pod 'CometChatCallsSDK', '4.0.7'
end
________________________________________________________________

And then install the CometChatCallsSDK framework through CocoaPods.

pod install

If you're facing any issues while installing pods then use the below command.

pod install --repo-update

2. Configure CometChat inside your app

i. Initialize CometChat 🌟

The init() method initializes the settings required for CometChatCallsSDK. We suggest calling the init() method on app startup, preferably in the didFinishLaunchingWithOptions() method of the Application class. If you are using CometChat's iOS Chats SDK then initialize Calls SDK after initializing Chat SDK.

import Foundation
import CometChatCallsSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    
    var window: UIWindow?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        
        let callAppSettings = CallAppSettingsBuilder()
            .setAppId(APP_ID)
            .setRegion(REGION)
            .build()
        
        CometChatCalls.init(callsAppSettings: callAppSettings) { success in
            print("CometChatCalls init success")
        } onError: { error in
            print("CometChatCalls init failed With error \(error)")
        }
        
        return true
    }

Note : Make sure you replace the APP_ID with your CometChat appId and region with your app region in the above code.


Note :

  • Make sure you replace the authKey with your CometChat Auth Key in the above code.

  • We have set up 5 users for testing having UIDs: SUPERHERO1, SUPERHERO2, SUPERHERO3, SUPERHERO4, and SUPERHERO5.


Checkout our sample apps

Swift:

Visit our Swift sample app repo to run the Swift sample app.


Help and Support

For issues running the project or integrating with our UI Kits, consult our documentation or create a support ticket or seek real-time support via the CometChat Dashboard.