Joakim Engstrom
Joakim Engstrom

Reputation: 6413

Androids Facebook SDK, single sign on question?

On Androids Facebook SDK there is a single login feature which I can't get to work. Done all the key hash thing but maybe there is something wrong with this method. What exactly should I pass on, or could somebody explain what this is supposed to do?

@Override

protected void onActivityResult(int requestCode, int resultCode, Intent data) { facebook.authorizeCallback(requestCode, resultCode, data); }

Upvotes: 0

Views: 2656

Answers (3)

George Mavchun
George Mavchun

Reputation: 1

facebookClient.authorize This method doesn't work on my device until I renamed those parameters: "com.facebook.katana","com.facebook.katana.ProxyAuth" to "com.facebook.katana1","com.facebook.katana.ProxyAuth1" =(

Upvotes: -1

Abhinav Manchanda
Abhinav Manchanda

Reputation: 6641

Facebook Single Sign On works fine, but the documentation is not all that great. Get your class to override the Facebook DialogListener.

To request Single Sign On, make sure you're calling Facebook to authorize your app -

 facebookClient = new Facebook(FB_APP_ID);

        facebookClient.authorize(this, 
            new String[] {"publish_stream", "read_stream", "offline_access"}, this);

And you also need to override the OnComplete method. Your OnActivityResult method is absolutely fine.

I used the code given by this gentleman here, and it worked perfectly fine for me, except that some of the code that he'd written was using the old API, so you might need to change some parameters passed to methods.

Upvotes: 3

dreamevil
dreamevil

Reputation: 11

I don't think single sign on could work well in the Facebook Android SDK. In the method private boolean startSingleSignOn(Activity activity, String applicationId,String[] permissions, int activityCode){} ,you will see below

Intent intent = new Intent();
        intent.setClassName("com.facebook.katana",
                "com.facebook.katana.ProxyAuth");

 try {
        activity.startActivityForResult(intent, activityCode);
    } catch (ActivityNotFoundException e) {
        didSucceed = false;
    }

In fact, package com.facebook.katana doesn't exist in the Facebook Android SDK.so the method private boolean startSingleSignOn(Activity activity, String applicationId, String[] permissions, int activityCode){} will return false ,then it means that single sign-on is Not available.

Upvotes: -1

Related Questions