Skip to content

cometchat/cometchat-sample-app-flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CometChat

Flutter Sample App by CometChat

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

Prerequisites

  • XCode for iOS and Android Studio for Android
  • pod (CocoaPods) for iOS
  • Android device or emulator with Android version 5.0 or above.
  • An iOS device or emulator with iOS 12.0 or above.
  • 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-flutter.git
    
  2. Navigate to the project directory:

    cd cometchat-sample-app-flutter
  3. Install flutter dependencies

    flutter pub get
  4. Enter your CometChat App ID, Region, and Auth Key in the lib/app_constants.dart file:

    class AppConstants {
    static const String appId = "APP_ID";
    static const String authKey = "AUTH_KEY";
    static const String region = "REGION";
    }

  5. 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 lib/services/api_services.dart file:

    final response = await http.get(
    Uri.parse('https://assets.cometchat.io/sampleapp/sampledata.json'),
    );

  6. For iOS, install dependencies after navigating to ios :

    cd ios
    pod install

    If you are facing any issue with pod install, you can try running the following command:

    pod update
  7. Open a Simulator or connect a physical device.

  8. Run the app on a device or emulator from the repo root.

    flutter run

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.