Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 271
Registered: ‎12-24-2010
My Device: BlackBerry 10
My Carrier: Airtel

BlackBerry Facebook SDK Login problem

I am trying to use Facebook SDK(FacebookBlackBerrySDK-v0.8.25.jar) from SourceForge

But after clicking the button, it is connecting to the facebook and showing login page. In the Login page, after giving the user name and password, it is showing: "Error. An error occured. Please try later." in the 9300 MDS simulator. I am trying for 5.0 OS and tried in different version and OS also. But result is same.

I am using the below code:

 

String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
    String APPLICATION_ID = "xxxxxxx";
    String APPLICATION_SECRET = "xxxxxxxxxxx";
    String[] PERMISSIONS = Facebook.Permissions.USER_DATA_PERMISSIONS;

    ApplicationSettings as = null;
    Facebook fb = null;

  as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
        fb = Facebook.getInstance(as);

//After clicking the button in my app

if(field == mCbFacebook)
        {
            try {

                User user = fb.getCurrentUser();
                user.publishStatus("Hello world!");
                Dialog.alert(""+fb.getCurrentUser());
            } catch (FacebookException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
}

  Can anyone please help..Where i am doing wrong??