开发者

Facebook chat can't work in Smack API with Android

I am developing chat client for my app. Now I am testing it on Gtalk, Facebook, Yahoo. I am using Smack api for that. I am now successfully tested it on Gtalk. But in case of Facebook I got error:

 01-13 10:53:05.938: INFO/XMPPClient(389): [SettingsDialog] Connected to chat.facebook.com
01-13 10:53:07.178: ERROR/XMPPClient(389): [SettingsDialog] Failed to log in as chikka0305@chat.facebook.com
01-13 10:53:07.178: ERROR/XMPPClient(389): SASL authentication failed using mechanism DIGEST-MD5: 

As you can see I can connect but can't login. I already saw same question here: http://stackoverflow.com/questions/3750547/facin开发者_开发问答g-problem-using-smack-on-android but answer of that doesn't work for me.


This is explained in this site: http://developers.facebook.com/docs/chat

You can see the following excerpt from this site.

Authenticating with Username/Password

The DIGEST-MD5 SASL mechanism is available to support traditional XMPP or multi-protocol IM clients that are not customized for (or even aware of) Facebook. This mechanism requires prompting the user for his or her password; therefore, it should only be used when necessary. In particular, it MUST NOT be used for any client that:

Proxies the XMPP connection (the connection must be directly from the user's computer to Facebook). Reports messages or any other information about user activity to a third party (including the client developer). Integrates with Facebook, or has a Facebook Application ID.

If your application does any of the above, you must use Facebook Platform authentication instead.

The user's Jabber ID is simply his or her Facebook user name with @chat.facebook.com appended. A user must have a Facebook username to use DIGEST-MD5. After the user gets his or her username, he or she must log out of and into Facebook once for us to store the special hash of the password.

If your application falls in any one of the case, then it may not work


i got my problem.it si perfectly work with asmack-issue 15.jar.and you have to set: connConfig.setSASLAuthenticationEnabled(true);


and you have to set write username only without @chat.facebook.com

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜