Unfortunately, we don't have the chat app example for Expo. Errors you've provided aren't related to ConnectyCube's services.
You can make chat app using our ConnectyCube SDK. The SDK supports Expo except WebRTC (video/audio calls).
See docs how to use ConnectyCube's API and chat for React Native here
Try simple code how to use ConnectyCube SDK with Expo:
- npx create-expo-app ExpoConnectyCube
- cd ExpoConnectyCube
- yarn add react-native-connectycube
- yarn ios
import { StatusBar } from "expo-status-bar";
import { useEffect, useState } from "react";
import { StyleSheet, Text, View } from "react-native";
import ConnectyCube from "react-native-connectycube";
const creds = {
appId: 385,
authKey: "DFBMs5-dKBBCXcd",
authSecret: "SkCW-ThdnmRg9Za",
};
const conf = {
debug: { mode: 1 },
};
const user = {
id: 72780,
login: "videouser1",
password: "videouser1",
};
export default function App() {
const [session, setSession] = useState("empty");
const [chat, setChat] = useState(false);
const [message, setMessage] = useState("");
const initConnectyCube = () => {
ConnectyCube.init(creds, conf);
};
const createAuthSession = () => {
ConnectyCube.createSession({ login: user.login, password: user.password })
.then((result) => {
setSession(result);
})
.catch((sessionError) => setChat(sessionError));
};
const chatConnect = () => {
ConnectyCube.chat.onMessageListener = (user, message) => {
setMessage({ user, message });
};
ConnectyCube.chat
.connect({ userId: user.id, password: user.password })
.then(() => {
setChat(true);
ConnectyCube.chat.send(user.id, { body: "Hello", type: "chat" });
})
.catch((chatError) => setChat(chatError));
};
useEffect(() => {
initConnectyCube();
createAuthSession();
chatConnect();
}, []);
return (
<View style={styles.container}>
<Text>{`Session: ${JSON.stringify(session)} \n`}</Text>
<Text>{`Chat connected: ${chat} \n`}</Text>
<Text>{`onMessage: ${JSON.stringify(message)} \n`}</Text>
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
justifyContent: "center",
},
});