-1

i'm trying to integrate Facebook Chat in android.

 facebook.authorize(this,new String[]{"xmpp_login"}, new DialogListener() {
            public void onComplete(Bundle values) {
                Log.w("XMPP","The Bundle Value is "+values);
                Log.w("XMPP","Connected Acess Token "+facebook.getAccessToken()+"App id "+facebook.getAppId());
                ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com", 5222);
                config.setSASLAuthenticationEnabled(true);
                XMPPConnection xmpp = new XMPPConnection(config);
                try
                {
                    SASLAuthentication.registerSASLMechanism("X-FACEBOOK-PLATFORM", SASLXFacebookPlatformMechanism.class);
                    SASLAuthentication.supportSASLMechanism("X-FACEBOOK-PLATFORM", 0);
                    xmpp.connect();
                    xmpp.login(facebook.getAppId(),facebook.getAccessToken());

               }
                catch(XMPPException e)
                {
                    Log.w("XMPP","Exception ");
                    e.printStackTrace();
                }

            }

The access token is AAACFZA9tieEABAN06ZBVMw33r0ZBbeszgPiy0Cr7Du400sFpz98cua3PAjjvKJS3dZCM7noAowPwjVr8xGBZBaV4etzAnlZCe6z0bn8itM3AZD

is the access token i right pattern ?

Can anyone please guide me ?

siva
  • 1,429
  • 3
  • 26
  • 47
  • Not really sure what your question is supposed to be about … you get access token, you use access token – what the heck does the “format” of it actually matter? – CBroe Jun 20 '12 at 18:25
  • The access token is of the format AAA|BBB|CCC AAA- being app id, BBB being the session key and etc.The newer formatted doesnt conform to this pattern.For details see this post @CBroe http://stackoverflow.com/questions/5317329/xmpp-with-java-asmack-library-supporting-x-facebook-platform – siva Jun 20 '12 at 18:39
  • @CBroe I hope format matters. – siva Jun 20 '12 at 18:39
  • For _what_? You still haven’t described any _problem_ that could probably be solved by answering this. – CBroe Jun 20 '12 at 18:46
  • Are you connected? You connect over TLS? – Philip Jun 20 '12 at 18:49
  • @siva is it ,can you able to get the accesstoken and app id from this code,i am also trying this one,but i cant get even the oncomplete function is also not executing – Karthick M Mar 28 '14 at 05:48

1 Answers1

0

Facebook have announce that XMPP Connections must be done over TLS from 6 June.

Apps connecting to Facebook's XMPP service will be required to use STARTTLS for all connections.
They will start rejecting unencrypted connections.

https://developers.facebook.com/blog/post/2012/05/16/platform-updates--operation-developer-love/

Philip
  • 5,011
  • 2
  • 30
  • 36