Closed 4RGUS closed 4 years ago
Nevermind. It was my mistake I was using the following piece of code:
xmpp.on("stanza", async (stanza) => {
if (stanza.is("message")) {
await xmpp.send(xml("presence", { type: "unavailable" }));
await xmpp.stop();
}
});
the xmpp.stop() made the connection to go offline.
I am using the library on react-native to create a chat demo application
Platform: "react-native": "0.61.5", "@xmpp/client": "0.11.1" macOS
My code:
When I start the server with :
xmpp.start().catch(console.error);
I track the status and it says:
connecting
Then I get a console log error:
offline
when I listen using:
after this I get warnings :
I checked the same configuration with WebSocket and it worked fine