Skip to content

Commit

Permalink
Updated to version v4.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
honey-cometchat committed Apr 4, 2024
1 parent f7d4945 commit b494e4c
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 85 deletions.
34 changes: 30 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ project.xcworkspace

# Android/IntelliJ
#
CometChatWorkspace/cometchat-app/android/app/build/
CometChatWorkspace/ios/Pods
cometchat-app/android/app/build/
ios/Pods
cometchat-app/android/app/build/
/android/app/build/
/app/build/
Expand All @@ -48,7 +48,8 @@ yarn.lock # include if you are using yarn - don't use both npm and yarn
buck-out/
\.buckd/
# *.keystore
!CometChatWorkspace/cometchat-app/android/app/debug.keystore
!cometchat-app/android/app/debug.keystore
!cometchat-app/android/app/my-upload-key.keystore

# Fastlane
#
Expand All @@ -62,10 +63,35 @@ buck-out/
*/fastlane/screenshots

# Pods
CometChatWorkspace/cometchat-app/ios/Pods/
cometchat-app/ios/Pods/
cometchat-app/ios/Pods/
/ios/Pods/
ios/Pods/*

# Bundle artifact
*.jsbundle

# Build file for ui-kit
cometchat-pro-react-native-ui-kit-1.0.0.tgz

# Logs
*.log
npm-debug.log

# Runtime data
tmp
build
lib

# Dependency directory
node_modules
*.DS_Store
example/development2
example/development
# Build file for local testing
cometchat-pro-react-native-ui-kit-1.0.0.tgz
package-lock.json
Pods
.idea
.gradle
vendor
63 changes: 36 additions & 27 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import React, { useEffect, useRef, useState } from 'react';
import { PermissionsAndroid, Platform, SafeAreaView, StatusBar, Text } from 'react-native';
import { PermissionsAndroid, Platform, SafeAreaView, StatusBar, StyleSheet, View } from 'react-native';
import { CometChat } from "@cometchat/chat-sdk-react-native";
import { AppConstants } from './AppConstants';
import { CometChatContextProvider, CometChatLocalize } from '@cometchat/chat-uikit-react-native';
Expand Down Expand Up @@ -80,33 +80,42 @@ const App = () => {
}, []);

return (
<SafeAreaView style={{ flex: 1 }}>
<StatusBar backgroundColor={"white"} barStyle={"dark-content"} />
{
callRecevied &&
<CometChatIncomingCall
call={incomingCall.current}
onDecline={(call) => {
setCallReceived(false)
}}
incomingCallStyle={{
backgroundColor: 'white',
titleColor: 'black',
subtitleColor: 'gray',
titleFont: {
fontSize: 20,
fontWeight: 'bold'
}
}}
/>
}
<UserContextProvider>
<CometChatContextProvider theme={new CometChatTheme({})}>
<StackNavigator />
</CometChatContextProvider>
</UserContextProvider>
</SafeAreaView>
<View style={styles.container}>
<SafeAreaView style={{ flex: 1 }}>
<StatusBar backgroundColor={"white"} barStyle={"dark-content"} />
{
callRecevied &&
<CometChatIncomingCall
call={incomingCall.current}
onDecline={(call) => {
setCallReceived(false)
}}
incomingCallStyle={{
backgroundColor: 'white',
titleColor: 'black',
subtitleColor: 'gray',
titleFont: {
fontSize: 20,
fontWeight: 'bold'
}
}}
/>
}
<UserContextProvider>
<CometChatContextProvider theme={new CometChatTheme({})}>
<StackNavigator />
</CometChatContextProvider>
</UserContextProvider>
</SafeAreaView>
</View>
);
};

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff"
}
})

export default App;
99 changes: 48 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,60 @@
<img alt="CometChat" src="https://assets.cometchat.io/website/images/logos/banner.png">
</p>

# iOS Sample App by CometChat
# React Native Sample App by CometChat

This reference application showcases the integration of [**CometChat's React Native UI Kit**](https://www.cometchat.com/docs/v4/react-native-uikit/overview) within an React Native framework. It provides developers with examples of implementing real-time messaging and voice and video calling features in their react native based applications.
This is a reference application showcasing the integration of [**CometChat's React Native UI Kit**](https://www.cometchat.com/docs/v4/react-native-uikit/overview) in React Native. It offers developers practical examples for incorporating real-time messaging, as well as voice and video calling functionalities, into their React Native based applications.

## Prerequisites
- Visual Studio Code or any other IDE.
- For iOS:
- XCode
- pod (CocoaPods)
- An iOS device or emulator with iOS 12.0 or above.
- For Android:
- Android Studio
- Android device or emulator with Android version 5.0 or above.
- Sign up for a [CometChat](https://app.cometchat.com/) account to get your app credentials: _`App ID`_, _`Region`_, and _`Auth Key`_

- Ensure that you have React Native development environment set up.
- Follow instructions for your environment at https://reactnative.dev/docs/environment-setup
- Sign up for a [CometChat](https://app.cometchat.com/) 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-react-native.git
```
2. Install dependencies
```sh
yarn install
```
3. Enter your CometChat _`App ID`_, _`Region`_, and _`Auth Key`_ in the [AppConstants.ts](./AppConstants.ts) file:
```typescript
export const AppConstants = {
APP_ID: 'APP_ID', // Enter your App ID
REGION: 'REGION', // Enter your App Region
AUTH_KEY: 'AUTH_KEY', // Enter your App Auth Key
}
```
4. For iOS, install dependencies after navigating to ios :
```sh
cd ios
pod install
```
5. Run the app on a device or emulator from the repo root.
```sh
yarn start
yarn run android
yarn run ios
```
<div style="
display: flex;
align-items: center;
justify-content: center;">
<img src="./Screenshots/login.png" alt="login" width="300">
</div>

1. Clone the repository:
- Using HTTPS
```
git clone https://github.com/cometchat/cometchat-sample-app-react-native.git
```
- Using SSH
```
git clone [email protected]:cometchat/cometchat-sample-app-react-native.git
```
2. Navigate to the cloned directory:
```
cd cometchat-sample-app-react-native
```
3. Install dependencies:
```
npm install
```
4. For iOS, install dependencies after navigating to ios:
```sh
cd ios
pod install
```
5. Enter your CometChat _`App ID`_, _`Region`_, and _`Auth Key`_ in the [src/AppConstants.ts](https://github.com/cometchat/cometchat-sample-app-react-native/blob/v4/AppConstants.ts) file:
https://github.com/cometchat/cometchat-sample-app-react-native/blob/f7d4945414da14405f5dece975c8cf43926b01c7/AppConstants.ts#L1-L5
6. Run the app on a device or emulator from the repo root.
```sh
npm start
npm run android
npm run ios
```

<table>
<tr>
<td valign="center">
<img src="./Screenshots/login.png" alt="login" width="300">
</td>
<td valign="center">
<img src="./Screenshots/login-android.png" alt="login" width="250">
</td>
</tr>
</table>

## Help and Support
For issues running the project or integrating with our UI Kits, consult our [documentation](https://www.cometchat.com/docs/react-native-uikit/integration) or create a [support ticket](https://help.cometchat.com/hc/en-us) or seek real-time support via the [CometChat Dashboard](http://app.cometchat.com/).

For issues running the project or integrating with our UI Kits, consult our [documentation](https://www.cometchat.com/docs/vue-uikit/integration) or create a [support ticket](https://help.cometchat.com/hc/en-us) or seek real-time support via the [CometChat Dashboard](http://app.cometchat.com/).
Binary file removed Screenshots/constants.png
Binary file not shown.
Binary file added Screenshots/login-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Screenshots/main.png
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cometchat-chat-sample-app-react-native",
"version": "4.3.0",
"version": "4.3.2",
"license": "SEE LICENSE IN LICENSE.md",
"private": true,
"scripts": {
Expand All @@ -13,8 +13,8 @@
"dependencies": {
"@cometchat/calls-sdk-react-native": "^4.0.4",
"@cometchat/chat-sdk-react-native": "^4.0.6",
"@cometchat/chat-uikit-react-native": "^4.3.0",
"@react-native-async-storage/async-storage": "1.17.10",
"@cometchat/chat-uikit-react-native": "^4.3.2",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-clipboard/clipboard": "^1.13.2",
"@react-native-community/cli-platform-android": "^8.0.5",
"@react-native-community/datetimepicker": "^7.6.2",
Expand Down

0 comments on commit b494e4c

Please sign in to comment.