cometchat / chat-sdk-react-native

Voice & Video Calling and Text Chat SDK for React Native
Other
18 stars 17 forks source link

Send message error while no internet #8

Closed ajaygajra closed 4 years ago

ajaygajra commented 4 years ago

https://forum.cometchat.com/t/comet-chat-failing-and-app-crashing-when-no-network-is-available/1372

ebrake commented 4 years ago

Could be related to https://forum.cometchat.com/t/connectionlistener-shows-connected-when-there-is-no-network-connection/1394/3 where the SDK thinks that it is connected when there is no network connection

arunnambissan commented 4 years ago

I am using the below code for sending messages. It’s not going inside the catch callback when there is no internet or the sendMessage function is failing.

CometChat.sendMessage(textMessage).then(
    message => {
        console.log("Message sent successfully:", message);
        resolve(message);
    },
    error => {
        console.log("Message sending failed with error:", error);
        reject(error)
    }
);
mayur-bhandari commented 4 years ago

This has been resolved in v2.0.9