Skip to content

Commit 49c25be

Browse files
Updated to version v4.3.4
1 parent 442d624 commit 49c25be

29 files changed

+4435
-3640
lines changed

.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ DerivedData
2121
*.ipa
2222
*.xcuserstate
2323
project.xcworkspace
24+
.xcode.env.local
2425

2526
# Android/IntelliJ
2627
#

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

App.tsx

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import React, { useEffect, useRef, useState } from 'react';
3-
import { PermissionsAndroid, Platform, SafeAreaView, StatusBar, StyleSheet, View } from 'react-native';
3+
import { ActivityIndicator, PermissionsAndroid, Platform, SafeAreaView, StatusBar, StyleSheet, View } from 'react-native';
44
import { CometChat } from "@cometchat/chat-sdk-react-native";
55
import { AppConstants } from './AppConstants';
66
import { CometChatContextProvider, CometChatLocalize } from '@cometchat/chat-uikit-react-native';
@@ -26,7 +26,8 @@ const App = () => {
2626
}
2727
}
2828

29-
const [callRecevied, setCallReceived] = useState(false);
29+
const [callReceived, setCallReceived] = useState(false);
30+
const [isInitialized, setIsInitialized] = useState(false);
3031
const incomingCall = useRef(null);
3132

3233
useEffect(() => {
@@ -42,6 +43,7 @@ const App = () => {
4243
if (CometChat.setSource) {
4344
CometChat.setSource('ui-kit', Platform.OS, 'react-native');
4445
}
46+
setIsInitialized(true);
4547
})
4648
.catch(() => {
4749
return null;
@@ -81,32 +83,37 @@ const App = () => {
8183

8284
return (
8385
<View style={styles.container}>
84-
<SafeAreaView style={{ flex: 1 }}>
85-
<StatusBar backgroundColor={"white"} barStyle={"dark-content"} />
86-
{
87-
callRecevied &&
88-
<CometChatIncomingCall
89-
call={incomingCall.current}
90-
onDecline={(call) => {
91-
setCallReceived(false)
92-
}}
93-
incomingCallStyle={{
94-
backgroundColor: 'white',
95-
titleColor: 'black',
96-
subtitleColor: 'gray',
97-
titleFont: {
98-
fontSize: 20,
99-
fontWeight: 'bold'
100-
}
101-
}}
102-
/>
103-
}
104-
<UserContextProvider>
105-
<CometChatContextProvider theme={new CometChatTheme({})}>
106-
<StackNavigator />
107-
</CometChatContextProvider>
108-
</UserContextProvider>
109-
</SafeAreaView>
86+
{isInitialized ? (
87+
<SafeAreaView style={{ flex: 1 }}>
88+
<StatusBar backgroundColor={"white"} barStyle={"dark-content"} />
89+
{callReceived && (
90+
<CometChatIncomingCall
91+
call={incomingCall.current}
92+
onDecline={(call) => {
93+
setCallReceived(false);
94+
}}
95+
incomingCallStyle={{
96+
backgroundColor: "white",
97+
titleColor: "black",
98+
subtitleColor: "gray",
99+
titleFont: {
100+
fontSize: 20,
101+
fontWeight: "bold",
102+
},
103+
}}
104+
/>
105+
)}
106+
<UserContextProvider>
107+
<CometChatContextProvider theme={new CometChatTheme({})}>
108+
<StackNavigator />
109+
</CometChatContextProvider>
110+
</UserContextProvider>
111+
</SafeAreaView>
112+
) : (
113+
<View style={[styles.container, {justifyContent: "center"}]}>
114+
<ActivityIndicator />
115+
</View>
116+
)}
110117
</View>
111118
);
112119
};

Gemfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ 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-
gem 'cocoapods', '~> 1.12'
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'

Gemfile.lock

Lines changed: 0 additions & 100 deletions
This file was deleted.

__tests__/App.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'react-native';
66
import React from 'react';
77
import App from '../App';
88

9-
// Note: import explicitly to use the types shiped with jest.
9+
// Note: import explicitly to use the types shipped with jest.
1010
import {it} from '@jest/globals';
1111

1212
// Note: test renderer must be required after react-native.

android/app/build.gradle

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34

45
/**
@@ -70,8 +71,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
7071

7172
android {
7273
ndkVersion rootProject.ext.ndkVersion
73-
74-
compileSdkVersion rootProject.ext.compileSdkVersion
74+
buildToolsVersion rootProject.ext.buildToolsVersion
75+
compileSdk rootProject.ext.compileSdkVersion
7576

7677
namespace "com.demosampleapp"
7778
defaultConfig {
@@ -106,13 +107,8 @@ android {
106107
dependencies {
107108
// The version of react-native is set by the React Native Gradle Plugin
108109
implementation("com.facebook.react:react-android")
110+
implementation("com.facebook.react:flipper-integration")
109111

110-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
111-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
112-
exclude group:'com.squareup.okhttp3', module:'okhttp'
113-
}
114-
115-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
116112
if (hermesEnabled.toBoolean()) {
117113
implementation("com.facebook.react:hermes-android")
118114
} else {

android/app/src/debug/java/com/demosampleapp/ReactNativeFlipper.java

Lines changed: 0 additions & 75 deletions
This file was deleted.

android/app/src/main/java/com/demosampleapp/MainActivity.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)