Closed maciey closed 3 years ago
Hi, I had the same pb due to my my poor experience to XMPP and the way this library is working ... You need to use the Service Discovery extension once connected in order to inform the server which XEP you are using. I had to add code in XmppIm.cs for this ... Perhaps there is a best way but I don't know how.
The code looks like this:
// List of extensions we want to manage
Extension[] extensions = new Extension[] { Extension.Ping, Extension.MessageCarbons, Extension.MultiUserChat, Extension.ChatStateNotifications };
ServiceDiscovery serviceDiscovery = GetExtension<ServiceDiscovery>();
serviceDiscovery.Supports(core.Jid.Domain, extensions);
Hope this help. Regards
NOTE: I'm working to add WebSocket support on this library. I have already a functional project for basic scenario (connection + presence + ping + message)
Many thanks replying. Im just starting with XMPP and this is still very dimmed area to me... Can you please advise were precisely I should add those lines in XmppIm.cs I try to search for serviceDiscovery / extensions etc but coudnt find good place Appreciate if you can share wider context or XmppIm.cs file copy
EDIT
Ive added SetExtenstions() mrthod to IM:
public void SetExtenstions () {
Extension[] extensions = new Extension[] { Extension.Ping, Extension.MessageCarbons, Extension.MultiUserChat, Extension.ChatStateNotifications };
ServiceDiscovery serviceDiscovery = GetExtension<ServiceDiscovery>();
serviceDiscovery.Supports(core.Jid.Domain, extensions);
}
then I've called it after I made connection:
cl.Connect();
cl.Im.SetExtenstions();
But still no luck :(
Can you plz advise what Im doing bad ?
In file XmppIm.cs
In
public Roster Connect(string resource = null) { ... }
just after
EstablishSession();
It should worked.
I can't shared directly my fil since i'm adding webSocket support
Works well now ! Thanks !!!!
Issue can be closed now
BTW. Maybe you can also advice re #67 (How to get history from server)? (Apologs being insistent but this is last functionality which stops me to switch to this great lib)
@maciey There is a close button at the bottom of this page. Please use that to close this issue.
Hi All,
I need some guidance - not sure what Im doing wrong... I can connect, send messages with this lib but I cant receive anything. Below code worked well with s22.xmpp - not sure what changed how I should change it
Eg using below code I cant receive any messages nor status changes information