Skip to content

Commit cac2268

Browse files
v4.3.9
1 parent f4d277b commit cac2268

File tree

110 files changed

+5772
-4816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+5772
-4816
lines changed

.gitignore

Lines changed: 26 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -20,77 +20,56 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
project.xcworkspace
24-
.xcode.env.local
23+
**/.xcode.env.local
2524

2625
# Android/IntelliJ
2726
#
28-
cometchat-app/android/app/build/
29-
ios/Pods
30-
cometchat-app/android/app/build/
31-
/android/app/build/
32-
/app/build/
33-
ios/Pods/*
3427
build/
3528
.idea
3629
.gradle
3730
local.properties
3831
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
36+
.kotlin/
3937

4038
# node.js
4139
#
4240
node_modules/
4341
npm-debug.log
4442
yarn-error.log
45-
yarn.lock # include if you are using yarn - don't use both npm and yarn
4643

47-
# BUCK
48-
buck-out/
49-
\.buckd/
50-
# *.keystore
51-
!cometchat-app/android/app/debug.keystore
52-
!cometchat-app/android/app/my-upload-key.keystore
53-
54-
# Fastlane
44+
# fastlane
5545
#
56-
# It is recommended to not store the screenshots in the git repo. Instead, use Fastlane to re-generate the
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
5747
# screenshots whenever they are needed.
5848
# For more information about the recommended setup visit:
5949
# https://docs.fastlane.tools/best-practices/source-control/
6050

61-
*/fastlane/report.xml
62-
*/fastlane/Preview.html
63-
*/fastlane/screenshots
64-
65-
# Pods
66-
cometchat-app/ios/Pods/
67-
cometchat-app/ios/Pods/
68-
/ios/Pods/
69-
ios/Pods/*
51+
**/fastlane/report.xml
52+
**/fastlane/Preview.html
53+
**/fastlane/screenshots
54+
**/fastlane/test_output
7055

7156
# Bundle artifact
7257
*.jsbundle
7358

74-
# Build file for ui-kit
75-
cometchat-pro-react-native-ui-kit-1.0.0.tgz
59+
# Ruby / CocoaPods
60+
**/Pods/
61+
/vendor/bundle/
7662

77-
# Logs
78-
*.log
79-
npm-debug.log
63+
# Temporary files created by Metro to check the health of the file watcher
64+
.metro-health-check*
8065

81-
# Runtime data
82-
tmp
83-
build
84-
lib
66+
# testing
67+
/coverage
8568

86-
# Dependency directory
87-
node_modules
88-
*.DS_Store
89-
example/development2
90-
example/development
91-
# Build file for local testing
92-
cometchat-pro-react-native-ui-kit-1.0.0.tgz
93-
Pods
94-
.idea
95-
.gradle
96-
vendor
69+
# Yarn
70+
.yarn/*
71+
!.yarn/patches
72+
!.yarn/plugins
73+
!.yarn/releases
74+
!.yarn/sdks
75+
!.yarn/versions

App.tsx

Lines changed: 59 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
1-
2-
import React, { useEffect, useRef, useState } from 'react';
3-
import { ActivityIndicator, PermissionsAndroid, Platform, SafeAreaView, StatusBar, StyleSheet, View } from 'react-native';
4-
import { CometChat } from "@cometchat/chat-sdk-react-native";
5-
import { AppConstants } from './AppConstants';
6-
import { CometChatContextProvider, CometChatLocalize } from '@cometchat/chat-uikit-react-native';
7-
import { CometChatTheme } from '@cometchat/chat-uikit-react-native';
8-
import { CometChatUIKit } from '@cometchat/chat-uikit-react-native';
1+
import React, {useEffect, useRef, useState} from 'react';
2+
import {
3+
ActivityIndicator,
4+
PermissionsAndroid,
5+
Platform,
6+
StatusBar,
7+
StyleSheet,
8+
View,
9+
} from 'react-native';
10+
import {CometChat} from '@cometchat/chat-sdk-react-native';
11+
import {AppConstants} from './AppConstants';
12+
import {
13+
CometChatContextProvider,
14+
CometChatLocalize,
15+
} from '@cometchat/chat-uikit-react-native';
16+
import {CometChatTheme} from '@cometchat/chat-uikit-react-native';
17+
import {CometChatUIKit} from '@cometchat/chat-uikit-react-native';
918
import StackNavigator from './src/StackNavigator';
10-
import { UserContextProvider } from './UserContext';
11-
import { CometChatIncomingCall } from '@cometchat/chat-uikit-react-native';
12-
import { CometChatUIEventHandler } from '@cometchat/chat-uikit-react-native';
13-
import { metaInfo } from './src/metaInfo';
14-
var listnerID = "UNIQUE_LISTENER_ID";
19+
import {UserContextProvider} from './UserContext';
20+
import {CometChatIncomingCall} from '@cometchat/chat-uikit-react-native';
21+
import {CometChatUIEventHandler} from '@cometchat/chat-uikit-react-native';
22+
import {metaInfo} from './src/metaInfo';
23+
import {SafeAreaView} from 'react-native-safe-area-context';
24+
const listenerID = 'UNIQUE_LISTENER_ID';
1525

1626
const App = () => {
17-
1827
const getPermissions = () => {
19-
if (Platform.OS == "android") {
28+
if (Platform.OS === 'android') {
2029
PermissionsAndroid.requestMultiple([
2130
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
2231
PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE,
@@ -25,11 +34,11 @@ const App = () => {
2534
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,
2635
]);
2736
}
28-
}
37+
};
2938

3039
const [callReceived, setCallReceived] = useState(false);
3140
const [isInitialized, setIsInitialized] = useState(false);
32-
const incomingCall = useRef(null);
41+
const incomingCall = useRef<CometChat.Call | null>(null);
3342

3443
useEffect(() => {
3544
getPermissions();
@@ -39,8 +48,10 @@ const App = () => {
3948
region: AppConstants.REGION,
4049
})
4150
.then(() => {
42-
CometChatLocalize.setLocale("en");
43-
try{CometChat.setDemoMetaInfo(metaInfo)}catch(err){}
51+
CometChatLocalize.setLocale('en');
52+
try {
53+
CometChat.setDemoMetaInfo(metaInfo);
54+
} catch (err) {}
4455
if (CometChat.setSource) {
4556
CometChat.setSource('ui-kit', Platform.OS, 'react-native');
4657
}
@@ -51,58 +62,57 @@ const App = () => {
5162
});
5263

5364
CometChat.addCallListener(
54-
listnerID,
65+
listenerID,
5566
new CometChat.CallListener({
56-
onIncomingCallReceived: (call) => {
67+
onIncomingCallReceived: (call: CometChat.Call) => {
5768
incomingCall.current = call;
5869
setCallReceived(true);
5970
},
60-
onOutgoingCallRejected: (call) => {
71+
onOutgoingCallAccepted: (call: CometChat.Call) => {
6172
incomingCall.current = null;
6273
setCallReceived(false);
6374
},
64-
onIncomingCallCancelled: (call) => {
75+
onIncomingCallCancelled: (call: CometChat.Call) => {
6576
incomingCall.current = null;
6677
setCallReceived(false);
6778
}
68-
})
79+
}),
6980
);
7081

71-
CometChatUIEventHandler.addCallListener(listnerID, {
82+
CometChatUIEventHandler.addCallListener(listenerID, {
7283
ccCallEnded: () => {
7384
incomingCall.current = null;
7485
setCallReceived(false);
7586
},
7687
});
7788

7889
return () => {
79-
CometChatUIEventHandler.removeCallListener(listnerID);
80-
CometChat.removeCallListener(listnerID)
81-
}
82-
90+
CometChatUIEventHandler.removeCallListener(listenerID);
91+
CometChat.removeCallListener(listenerID);
92+
};
8393
}, []);
8494

8595
return (
86-
<View style={styles.container}>
96+
<SafeAreaView style={styles.container}>
8797
{isInitialized ? (
88-
<SafeAreaView style={{ flex: 1 }}>
89-
<StatusBar backgroundColor={"white"} barStyle={"dark-content"} />
98+
<>
99+
<StatusBar backgroundColor={'white'} barStyle={'dark-content'} />
90100
{callReceived && (
91101
<CometChatIncomingCall
92102
call={incomingCall.current}
93-
onDecline={(call) => {
103+
onDecline={call => {
94104
setCallReceived(false);
95105
}}
96-
onError={(error) => {
106+
onError={error => {
97107
setCallReceived(false);
98108
}}
99109
incomingCallStyle={{
100-
backgroundColor: "white",
101-
titleColor: "black",
102-
subtitleColor: "gray",
110+
backgroundColor: 'white',
111+
titleColor: 'black',
112+
subtitleColor: 'gray',
103113
titleFont: {
104114
fontSize: 20,
105-
fontWeight: "bold",
115+
fontWeight: 'bold',
106116
},
107117
}}
108118
/>
@@ -112,21 +122,26 @@ const App = () => {
112122
<StackNavigator />
113123
</CometChatContextProvider>
114124
</UserContextProvider>
115-
</SafeAreaView>
125+
</>
116126
) : (
117-
<View style={[styles.container, {justifyContent: "center"}]}>
127+
<View style={styles.loading}>
118128
<ActivityIndicator />
119129
</View>
120130
)}
121-
</View>
131+
</SafeAreaView>
122132
);
123133
};
124134

125135
const styles = StyleSheet.create({
126136
container: {
127137
flex: 1,
128-
backgroundColor: "#fff"
129-
}
130-
})
138+
backgroundColor: '#fff',
139+
},
140+
loading: {
141+
flex: 1,
142+
justifyContent: 'center',
143+
alignItems: 'center',
144+
},
145+
});
131146

132147
export default App;

Gemfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7-
# bound in the template on Cocoapods with next React Native release.
8-
gem 'cocoapods', '>= 1.13', '< 1.15'
9-
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'
10+
gem 'concurrent-ruby', '< 1.3.4'

0 commit comments

Comments
 (0)