ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
125 stars 111 forks source link

Cannot find message Listeners in Version 3.7.2 #136

Closed mikeangelsilva closed 3 years ago

mikeangelsilva commented 3 years ago

Hi, i'm using the react native connectycube sdk on my development.the version i'm using is 3.72, when i tried using this code. (from react native documentation in connectycube doc site)

ConnectyCube.chat.onDeliveredStatusListener = function (messageId, dialogId, userId) { console.log("[ConnectyCube.chat.onDeliveredStatusListener] callback:", messageId, dialogId, userId);};

the.onDeliveredStatusListeneris not defined. 

also i tried the other listeners. but i cant't find the listeners as mentioned in the documentation site.

image

how can i use that? it seems that version is not compatible in my react native version (0.63.2)

please help me on this issue.  Thank you.

ccvlad commented 3 years ago

Hi, @mikeangelsilva Symbol "_" uses for methods' names to show that the method is private. So, this listeners uses inside the ConnectyCube SDK, you do not need to use they. It is conventional rule for JavaScript language. Do not fully trust to a code editor's extension. It does not work as you expect. JS is not compiled language. Chat listeners are not methods of the Chat class. You should define each chat's listener by a function. Just try the code in development.

mikeangelsilva commented 3 years ago

Hi, @mikeangelsilva Symbol "_" uses for methods' names to show that the method is private. So, this listeners uses inside the ConnectyCube SDK, you do not need to use they. It is conventional rule for JavaScript language. Do not fully trust to a code editor's extension. It does not work as you expect. JS is not compiled language. Chat listeners are not methods of the Chat class. You should define each chat's listener by a function. Just try the code in development.

mikeangelsilva commented 3 years ago

tried using it. still not working the listener. please help me. we cant really proceed in the next step because of this listener.

mikeangelsilva commented 3 years ago

this is the code i used. image

mikeangelsilva commented 3 years ago

also tried this. image not working. :(

ccvlad commented 3 years ago

Show your logs, please. The code snippet you have provided is correct, but this is not enough to understand the problem. You can get logs from Metro serrver / Chrome debugger / AndroidStudio / XCode