facebook connect for android returns a blank login screen?

Posted by jonney on Stack Overflow See other posts from Stack Overflow or by jonney
Published on 2010-11-18T15:02:13Z Indexed on 2011/01/07 6:53 UTC
Read the original article Hit count: 807

Filed under:
|

Hi, i am trying to use the old facebook connect authentication to authenticate my android client to get the necessary session id's and other credentials thats needed to start using the web service of facebook.

the issue i am having is that when my android application launces and tries to load the login page for facebook, that very same login page is blank and it only displays the the facebook logo as the title of the screen.

No login fields or buttons are visible leaving me nowhere to login and authenticate a user.

i have tried two API's one is facebook connect api for android http://code.google.com/p/fbconnect-android/ and the other one is the official android facebook sdk that is recommended to be used instead of the previous one i have just mentioned https://github.com/facebook/facebook-android-sdk/ .

please see the image below of how it looks like on my app.

alt text

Here is code that uses the latest android sdk facebook:

/**
 * Authenticate facebook network
 */
private void authenticateFacebook() {
    // TODO: move this away from this activty class into some kind of
    // helper/wrapper class
    Log.d(TAG, "Clicked on the facebook");

    Facebook facebook = new Facebook(OAUTH_KEY_FACEBOOK_API);

    facebook.authorize(this, new AuthorizeListener());
}

class AuthorizeListener implements DialogListener{

    @Override
    public void onComplete(Bundle values) {
        // TODO Auto-generated method stub
        Log.d(TAG, "finished authorizing facebook user");

    }

    @Override
    public void onFacebookError(FacebookError e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onError(DialogError e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onCancel() {
        // TODO Auto-generated method stub

    }

}

And a simple example of how to use it: http://developers.facebook.com/docs/guides/mobile/

My code is more or less identical to the above example.

edit: i did not catch what logcat was inputing in my first attempted at my code above but their was no exceptions or warnings thrown at the time. just a blank page.

i then tried it again and diddnt touch my code and what happens now is that a loading dialogue view pops up and stays their for a few minutes until the facebook windows disapears and the logcat outputs the error below:

11-18 17:26:19.913: DEBUG/Facebook-WebView(783): Webview loading URL: https://www.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=e??????????????????? 11-18 17:27:01.756: DEBUG/Facebook-authorize(783): Login failed: com.kc.unity.agent.util.oauth.facebook.DialogError: The connection to the server was unsuccessful. 11-18 17:27:01.783: DEBUG/Facebook-WebView(783): Webview loading URL: https://www.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=???????????????

please note that the client id i have amended for obvious reasons but the rest of the logcat is untouched

© Stack Overflow or respective owner

Related posts about android

Related posts about facebook-connect