Hi,
I’m using smack API to develop a facebook chat app. The problem appear when I use the method disconnect() of XMPPConnection. Disconnect does not work as it should. User stays online and is visible, for 120 seconds after disconnection, to other facebook friends on chat. I want it disappear immediately or about 10-30 seconds after disconnection.
Who can help me?
Thanks in advance.
Offhand, this doesn’t appear to be a Smack issue, but a refresh issue with Facebook.
Have you tried connecting to other servers to see if you still see this issue?
How can I fix this problem?
First you have to determine where and what the problem is. If it is a refresh issue on Facebook, then you will have to ask them what your options are.
As I said before, try to isolate your problem by seeing if this same issue exists when you have your client connect to a different server and the other user is also connected via a standalone client (Spark, Pidgin…).
It will be difficult to fix it if you don’t know where the actual problem is.
I am sure it is because of Smack. I tried using Pidgin and it didn’t face this problem. I also used jfbchat which is a chat client base on Smack and have the same problem.
After check the source code of Smack I guess it maybe because of class PacketWriter.java, there is a line “Thread.sleep(15000)”. I’m not sure but I want to change this and then re-build jar file. How can I do it?