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
Developer
burakk
Posts: 149
Registered: ‎04-23-2011
My Device: BlackBerry 9700 Bold
My Carrier: Turkcell

Getting Facebook user information for an BlackBerry application

[ Edited ]

Dear BlackBerry Developers,

 

I am developing an application where users will be able to login with their Facebook accounts and their names-surnames, gender and e-mail info will be used by the application. I was looking for a simple solution, and came accross Facebook BlackBerry SDK v0.8.24. However, I could not manage to login and get the information.

 

I read the README.pdf file and completed the steps, however could not even log in. Below is the code I'm using:

 

 public MyScreen()
    {             
        setTitle("MyTitle");
        
        String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
        String APPLICATION_ID = "113365482097876";
        String APPLICATION_SECRET = "xxxyyyzzz4fa1ad46af9ced88943d222";
        String[] PERMISSIONS = Facebook.Permissions.USER_DATA_PERMISSIONS;
        ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
        Facebook fb = Facebook.getInstance(as);
        
        try {
			User user = fb.getCurrentUser();
			setTitle(user.getFirstName());
		} catch (FacebookException e) {
			e.printStackTrace();
			setTitle(new LabelField("Error Encountered", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH));
			add(new LabelField("Exception: " + e.getMessage()));
		}
        
    }

 

When I am running this program on the simulator, the simulator starts with: JVM Error 104: Uncaught: Runtime Exception. Then, after skipping that and running the application, it says: Exception: Unable to refresh the access token.

 

I am really frustrated with this and need help. Thanks in advance.

 

 

Please use plain text.
New Developer
ebaskoro
Posts: 27
Registered: ‎11-03-2009
My Device: 8320
My Carrier: XL

Re: Getting Facebook user information for an BlackBerry application

Please give us more information as to which versions of JDE/Eclipse and simulator you are using.

 

Cheers.

EB

Please use plain text.
Developer
Pocket
Posts: 61
Registered: ‎08-12-2011
My Device: Curve 8520

Re: Getting Facebook user information for an BlackBerry application

If you could provide a link to the SDK you're using as well, it could be severely outdated.

 

Also, it's probably noteworthy that people have been posting about problems within the Facebook SDK, see here (for a potential solution):

 

http://supportforums.blackberry.com/t5/Java-Development/Facebook-SDK-not-working-from-2-days/td-p/12...

http://supportforums.blackberry.com/t5/Java-Development/Facebook-SDK-problems/td-p/730881

Please use plain text.
Developer
burakk
Posts: 149
Registered: ‎04-23-2011
My Device: BlackBerry 9700 Bold
My Carrier: Turkcell

Re: Getting Facebook user information for an BlackBerry application

[ Edited ]

Hi,

 

I am using BlackBerry Java Plug-in for Eclipse Version: 1.3.0

 

and BlackBerry Smartphone Simulator 2.13.0.108

 

I had downloaded the version FacebookBlackBerrySDK-0.8.24-bin.zip

 

 

 

 

Best regards,

 

burakk

Please use plain text.
New Developer
ebaskoro
Posts: 27
Registered: ‎11-03-2009
My Device: 8320
My Carrier: XL

Re: Getting Facebook user information for an BlackBerry application

Have you tried using the latest release (0.8.25)?

 

Cheers.

EB

Please use plain text.
Developer
burakk
Posts: 149
Registered: ‎04-23-2011
My Device: BlackBerry 9700 Bold
My Carrier: Turkcell

Re: Getting Facebook user information for an BlackBerry application

Yes, unfortunately I'm still getting the same error. What would you suggest me to look at first? Thanks in advance

 

 

Teşekkürler :smileyhappy:

Please use plain text.
New Developer
ebaskoro
Posts: 27
Registered: ‎11-03-2009
My Device: 8320
My Carrier: XL

Re: Getting Facebook user information for an BlackBerry application

You can try the following:

 

  1. Make sure you run against BlackBerry JRE 5.0.0 and above;
  2. Disable MDS and make sure in the simulator use the 2G/3G or WiFi network settings;

If all fails you may want to run in debug mode and see what's printed in the Console.

 

Cheers.

EB

Please use plain text.
Developer
burakk
Posts: 149
Registered: ‎04-23-2011
My Device: BlackBerry 9700 Bold
My Carrier: Turkcell

Re: Getting Facebook user information for an BlackBerry application

[ Edited ]

I got it working, thanks...

Please use plain text.
Developer
jromanoski
Posts: 90
Registered: ‎09-07-2010
My Device: Not Specified

Re: Getting Facebook user information for an BlackBerry application

Hello,

 

I am having the same problem, how did you fixed it?

Please use plain text.
msr
New Contributor
msr
Posts: 7
Registered: ‎08-24-2011
My Device: storm 9500
My Carrier: 5.0

Re: Getting Facebook user information for an BlackBerry application

Hi,

 

I am getting the same problem and search a lot for that problem but I am unable to fix that issue.

Please post the solution. So that i can solve the problem and other can also get the solution

Please use plain text.