I assume apiKey is the App ID. I tried using the App Secret as the accessToken but that didn’t work. How do I get the accessToken?
Also, while we’re at it, just to make sure, please confirm: the expected behavior is at connection.login, the Facebook login screen appears, the user logs in, the user is returned to my application, and connection is now authenticated – i.e. I don’t need to worry about returning to my application or handling return messages.
I am developing a simple chat client for FB. I have progressed to a state where now i have the access_token of the user who had logged in to my chat with “xmpp_login” and “offline_access” scope. Am able to successfully connect to chat.facebook.com and also login using api_key and the access_token. There is no problem in the SASL Authentication.
Now when i try to send a message using, chat.sendMessage(String) or chat.sendMessage(Message), the smack debugger shows the message has been sent. But on my facebook website, I dont see that message sent to that person. The other person is also not receiving the message. If i am able to log in there is nothing wrong with the access token right?
hellokVfox0
This is the output from Smack debugger Sent column. Is there anything wrong with the from address? or with this message structure? Am stuck at this point because i dont know how to debug this issue.
Any advice, suggestions or solutions are most welcome.
FWIW, I think it is actually your “to” address that is problematic; you should get the user-id and use that instead of the user-name. At least that’s what worked for me.
In my case, the other user visited a web page I control – so I was able to use FB’s Javascript API to get their id.
When I am compiling the SASLXFacebookPlatformMechanism from your package, I am getting the following error “The method send(Packet) in the type SASLAuthentication is not applicable for the arguments (String)” for getSASLAuthentication().send(stanza.toString());
Any ideas why?
I have the smack.jar and smackx.jar in my build path.
Perhaps it’s a change in Smack – I worked with version 3.1.0, and there SASLAuthentication had a send(String) method (at the time I write this, the latest version seems to be 3.2.2). I am currently not actively involved in the project which brought me here before, so I cannot follow and fix stuff.
I just remembered having some problems related to this with different JDKs. Try compiling with both Java 1.6 and Java 1.7 (or, if you can get it, even Oracle Java), I think one of them may work where the other doesn’t.