Closed ParmarJigarr closed 2 years ago
Hi @ParmarJigarr
Device's OS closes chat connection after some time in inactive state.
I suggest you import '@react-native-community/netinfo' and listen to internet connection. Do ConnectyCube.chat.disconnect()
when your app losses internet connection and call ConnectyCube.chat.connect(params)
after the internet becomes online.
okay so where i have to do this code of internet connection ? on press of send message of somewhere else ? also my internet connection is on still i have to perform this step ?
You have to put it inside some service class file
because it's a listener
import NetInfo from "@react-native-community/netinfo";
// Subscribe
const unsubscribe = NetInfo.addEventListener(state => {
console.log("Connection type", state.type);
console.log("Is connected?", state.isConnected);
});
// Unsubscribe
unsubscribe();
if i try to send message after some time from customer side app (app was idle for about 10 minutes) , the message was not sent into other driver side app. i need to kill the app and reopen app the it will work fine