Introducing CometChat UIKitV4 UI kits offer modular design, extended functionality & customization for a tailored chat experience. Check out our new UIKits here.
The CometChat React Native UI Kit cuts development efforts significantly when integrating text, voice and video messaging into your React Native chat application.
The React Native UI Kit’s customizable React Native chat UI components simplify the process of integrating text chat and voice/video calling features to your website or mobile application in a few minutes.
I want to checkout React Native Chat UI Kit.
Follow the steps mentioned in the README.md file.Kindly, click on below button to download our React Native Chat UI Kit..React Native Chat UI KitView on Github
The init() method initializes the settings required for CometChat. We suggest calling the init() method on app startup, preferably in the created() method of the Application class.
Copy
Ask AI
import {CometChat} from '@cometchat-pro/react-native-chat';const appID = 'APP_ID';const region = 'REGION';const appSetting = new CometChat.AppSettingsBuilder() .subscribePresenceForAllUsers() .setRegion(region) .build();CometChat.init(appID, appSetting).then( () => { console.log('Initialization completed successfully'); // You can now call login function. }, (error) => { console.log('Initialization failed with error:', error); // Check the reason for error and take appropriate action. },);
Replace APP_ID and REGION with your CometChat App ID and Region in the above code
Login your user 👤
This method takes UID and Auth Key as input parameters and returns the User object containing all the information of the logged-in user.
Replace AUTH_KEY with your CometChat Auth Key in the above code.
We have set up 5 users for testing having UIDs: cometchat-uid-1, cometchat-uid-2, cometchat-uid-3, cometchat-uid-4, and cometchat-uid-5.We have used uid cometchat-uid-1 as an example here. You can create a User from CometChat Dashboard as well.
CometChatUI is an option to launch a fully functional chat application using the React Native Chat UI Kit. In CometChatUI all the UI Components are interlinked and work together to launch a fully functional chat on your website/application.
Copy
Ask AI
import React from 'react';import {View} from 'react-native';import {CometChatUI} from '../cometchat-pro-react-native-ui-kit';export default function CometChatUIView() { return ( <View style={{flex: 1}}> <CometChatUI /> </View> );}