Closed stephanoparaskeva closed 2 years ago
Are you connected to chat before using ConnectyCube.chat.send
? If not then it will not work.
Make sure you are connected to chat by calling ConnectyCube.chat.connect
Regarding Network requests, the ConnectyCube.chat.send
call does not do a common XHR request.
Instead you should look into WSS tab -
@DaveLomber I am connected when checking ConnectyCube.chat.isConnected
. I see, thank you for explaining this to me.
But even still, no messages actually get created and stored to the dialog when calling ConnectyCube.chat.send
, I can only get it to work when making an axios
request.
By the way, is there any other way of contacting if I get anymore questions, I'd really appreciate that, rather than having to make an issue on these great Repo's every time I run into a small problem that I cannot myself fix.
@stephanoparaskeva it's totally fine to create GitHub issues as many as you need ;)
Let's check the following:
1) what you see in WS tab, Messages section (as shown in my screenshot above)? 2) what you see in browser console log when send a message ?
@stephanoparaskeva it's totally fine to create GitHub issues as many as you need ;)
Let's check the following:
- what you see in WS tab, Messages section (as shown in my screenshot above)?
- what you see in browser console log when send a message ?
Awesome okay! This works
export const getCubeToken = () => ConnectyCube?.auth?.proxy?.sdkInstance?.session?.token;
const cubeToken = getCubeToken();
await axios({
method: 'post',
url: 'https://api.connectycube.com/chat/Message',
headers: { 'CB-Token': cubeToken },
data: {
recipient_id: recipient?.cubeId,
type: 3,
markable: 1,
message: msg,
send_to_chat: 1,
},
});
This does not:
ConnectyCube.chat.send(recipient?.cubeId, message)
@stephanoparaskeva
Could you enable a logger and provide logs after ConnectyCube.chat.send(recipient?.cubeId, message)
?
@stephanoparaskeva could you please guide me how to add the onMessage listeners in function components. Looks like you have used function components in your project.
Closed due to inactivity. Please create a new issue if needed.
I am using the opponent id eg: 3030123 and sending a chat message via 1 on 1 chat. The onMessage listener on the other device never runs and no messages are listed in the dialog:
Screenshot
Code
When viewing Network Inspector, it seems that this function does not make a network request at all.
Version:
"react-native-connectycube": "^3.7.8",