Skip to content

cometchat/cometchat-sample-app-ios

Repository files navigation

CometChat

iOS Sample App by CometChat

This reference application showcases the integration of CometChat's iOS UI Kit within an iOS framework. It provides developers with examples of implementing real-time messaging and voice and video calling features in their iOS-based applications.

Prerequisites

  • Xcode
  • pod (CocoaPods)
  • Sign up for a CometChat account to get your app credentials: App ID, Region, and Auth Key

Installation

  1. Clone the repository:

    git clone https://github.com/cometchat/cometchat-sample-app-ios.git
    
  2. Navigate to the project directory:

      cd cometchat-sample-app-ios/CometChatSwift
  3. Install dependencies:

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

      pod install --repo-update
  5. In Xcode, open the project by opening cometchat-sample-app-ios/CometChatSwift.xcworkspace

  6. Enter your CometChat App ID, Region, and Auth Key in the CometChatSwift/AppConstants.swift file:

    class AppConstants {
    static var APP_ID = "<# Enter Your App ID Here #>"
    static var AUTH_KEY = "<# Enter Your AuthKey Here #>"
    static var REGION = "<# Enter Your Region Code Here #>"
    }

  7. If your app is created before August 12th, 2024 then change the sample data URL to https://assets.cometchat.io/sampleapp/v1/sampledata.json in the CometChatSwift/Controllers/Login.swift file:

    func fetchSampleLoginData(){
    let url = URL(string: "https://assets.cometchat.io/sampleapp/sampledata.json")!
    URLSession.shared.fetchData(for: url) { (result: Result<SampleUsers, Error>) in

  8. Run the app on a device or emulator.

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.