Problems with smack3.2.0 and Facebook

Hi!! I’m trying to create a xmpp client using smack 3.2. I had no problems when connecting with Jabber and Gmail but Facebook is another issue. I have searched for a solution to it and what I have found implies a downgrade to smack 3.1.0. I have tried it and it works.

The question is, is not it possible to login in Facebook using smack 3.2?? Has anyone managed it??

Thanks in advance!!!

well what is happening when you try connecting to facebook??

Hi!!

What I do to connect, using Smack3.2.0, is this:

SASLAuthentication.registerSASLMechanism(“DIGEST-MD5”,SASLDigestMD5Mechanism.cla ss);

ConnectionConfiguration config = new ConnectionConfiguration(“chat.facebook.com”,5222,“chat.facebook.com”);

connection = new XMPPConnection(config);

connection.login(userName, password);

Where userName only includes username you have in FB, not the number, wihtout @chat.facebook.com.

And what I get is this:

Exception in thread “main” SASL authentication failed using mechanism DIGEST-MD5:

at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java: 325)

at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:395)

at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:349)

at client.InitSession.loginFacebook(InitSession.java:45)

at client.InitSession.main(InitSession.java:112)

So I decided to download Smack 3.1.0 and use the solution consisting on having your own SASLDigestMD5Mechanism.class, MySASLDigestMD5Mechanism.class, and it works perfectly.

Using this I can perfectly chat with FB.

Another problem I have now is that I can log in Gmail and Jabber, and I can send them messages, but I don’t receive any…

As you can see everything is a problem to me, hehehe.

Thanks for your time!!!

Are you sure this isn’t because you missed out on connection.connect() before calling login()?

Why are you trying to connect differently in 3.1 vs. 3.2?

Before saying you need to downgrade, try running the same code with 3.2.