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
Contributor
Posts: 27
Registered: ‎02-04-2011
My Device: Not Specified

Re: new Facebook BlackBerry SDK 0.3.1 is out.

[ Edited ]

I downloaded the new FB SDK  (0.3.5) and built the sample "Strawberry" app. When I run it on a Bold 9780 with OS 6.0, I see the LoginScreen and after logging in the BrowserField seems to redirect to my FB page... and the LoginScreen is never popped. When I click the "back" button, the app quits entirely.

 

On a Storm 9550 running OS 5.0, the same sample app worked as expected.

 

Has anyone else seen this issue? I'm going to investigate it a bit with debugging printfs but, just wanted to post this now to see if it's been reported or noticed by anyone else.

 

Editted to add:

 

Just wanted to note that I actually had this problem with the 0.3.1 version of the FB SDK too, but since 0.3.5 was available before I could post about it, I thought I would give it a chance before complaining about an old version.

Developer
Posts: 466
Registered: ‎03-04-2009
My Device: 8520
My Carrier: some

Re: new Facebook BlackBerry SDK 0.3.1 is out.

I am using fb sdk 0.3.5 inside my app and didn't see such problem. Tested on both 5.0 and 6.0

Got resolved! Press kudo icon!
Contributor
Posts: 27
Registered: ‎02-04-2011
My Device: Not Specified

Re: new Facebook BlackBerry SDK 0.3.1 is out.

Interesting... well I definitely wouldn't rule out that I am doing something wrong.

 

When I checked the debug output, I noticed that what seems to happen is that the request handler never sees a URL containing the "access_token" string.

 

However, if I quit the app and start it again, the user is prompted to allow the "BlackBerry SDK Demo" access to their profile, and after that, the Strawberry app starts with the screen and buttons as it should.

 

So this problem only happens on the first time they try to log in.

 

Thanks for any help!

Contributor
Posts: 14
Registered: ‎08-17-2010
My Device: Not Specified

Re: new Facebook BlackBerry SDK 0.3.1 is out.

1. In the facebook login page, if I select "Cancel" then I'm still getting the "Sucess" page. OnCancel the app should close the login view!

 

2. In v0.3.5 FacebookContext implements Persistable. This could throw "multiply defined" error, when more than one app uses the same package name and use it as lib. I'd keep all the "Persistable" stuff in the sample.strawberry package and let the FB API lib remain reusuable accross multiple apps. API v0.2.0 solved this using FacebookSettings class. We could keep this file within the app and rest of lib free from multiply defined problem.

 

Thanks!

Developer
Posts: 466
Registered: ‎03-04-2009
My Device: 8520
My Carrier: some

Re: new Facebook BlackBerry SDK 0.3.1 is out.

regarding the first issue you have to handle in yourself. If you need any help just let me know.

Got resolved! Press kudo icon!
Developer
Posts: 28
Registered: ‎10-30-2010
My Device: Torch 9800

Re: new Facebook BlackBerry SDK 0.3.1 is out.

I'm running the Strawberry sample on 9800 simulator. I actually deleted the app from my FB before trying, so it would have to go through the permissions I guess. I got the following 2 screens:

 

First one, no log in button or whatsoever, need to press the enter key to log in

9800.jpg

Second one, no allow or don't allow button, got stuck and couldn't move any further.

9800-01.jpg

Does anyone have the same problem as I do? Based on the posts I read from this thread, it looks like I'm the only one having this issue.

 

Can anyone shed some light on me?

 

Thanks!

Contributor
Posts: 27
Registered: ‎02-04-2011
My Device: Not Specified

Re: new Facebook BlackBerry SDK 0.3.1 is out.

Does the SDK support extended permissions? The Readme isn't clear on that, and I can't find anything in the source that would indicate it does, although I haven't looked all that hard I guess..

Developer
Posts: 466
Registered: ‎03-04-2009
My Device: 8520
My Carrier: some

Re: new Facebook BlackBerry SDK 0.3.1 is out.

well, yes. At least if you want to ask to grant some permissions (the snippet from README.pdf) :

If your application needs to access other parts of the user's profile that may be private, your application can request extended permissions by the “scope” parameter of the login query string.

 

Example:
http://www.facebook.com/dialog/oauth?client_id=153555168010272&redirect_uri=http://www.facebook.com/...

 

Got resolved! Press kudo icon!
Contributor
Posts: 27
Registered: ‎02-04-2011
My Device: Not Specified

Re: new Facebook BlackBerry SDK 0.3.1 is out.

Actually, since I asked that question, I tried messing around in there and found that if I added the permissions I wanted to the URL as in the Readme, I see that FB will show the appropriate permissions dialog and send the data in the JSON response.

 

Am I correct in thinking that, if we want to collect email addresses, we would need to modify the FB SDK slightly to get at the parsed JSON hashtable ? 

 

I couldn't find anything in the FBUser class which would access any of the extended permissions.

 

@sonicboomboy thanks for your help, you've been very responsive to this thread!

Contributor
Posts: 27
Registered: ‎02-04-2011
My Device: Not Specified

Re: new Facebook BlackBerry SDK 0.3.1 is out.

We still cannot get this working on 6.0. I'm testing on a Torch, physical device. The OS version is apparently a bit out of date, but I tested on someone's personal device here, another Torch, which has apparently the latest version as reported to me in this thread:

 

http://supportforums.blackberry.com/t5/Java-Development/where-can-I-find-out-what-the-latest-update-...

 

I'm going to try explaining what happens when we try to run the sample StrawBerry app on the phone, and describe my theory about why it doesn't work. I'm not an expert when it comes to HTTP and browsers, so this is all a bit hand-wavy...

 

On the Torch, when we start the StrawBerry app, it loads up the LoginScreen.java and its BrowserField. The layout looks messed up -- it looks like the desktop version of the FB login page, and the text fields for email and password are cut off. Someone else in this thread described something similar.

 

After entering the email/password, the BrowserField redirects to the FB homepage of the user -- the same page you would see if you just logged into FB via their homepage.

 

I captured the output of the FB SDK's log, and have included it here:

 

2011-02-14 17:17:41 [DEBUG] BF-Navigate: http://www.facebook.com/dialog/oauth?scope=publish_stream,offline_access,email&redirect_uri=http://w...
2011-02-14 17:17:41 [DEBUG] Access Token not found.
2011-02-14 17:17:52 [DEBUG] BF-Navigate: http://www.facebook.com/login.php
2011-02-14 17:17:52 [DEBUG] Access Token not found.
2011-02-14 17:20:37 [DEBUG] BF-Navigate: http://www.facebook.com/home.php
2011-02-14 17:20:37 [DEBUG] Access Token not found.

 

 

 

 

Here are the logs for the log in process when I run this same app on a Storm, with OS 5:

 

 

2011-02-14 16:03:40 [DEBUG] BF-Navigate: http://www.facebook.com/dialog/oauth?scope=publish_stream,offline_access,email&redirect_uri=http://w...
2011-02-14 16:03:40 [DEBUG] Access Token not found.
2011-02-14 16:03:42 [DEBUG] BF-Navigate: http://www.facebook.com/connect/uiserver.php?app_id=153555168010272&method=permissions.request&displ...
2011-02-14 16:03:42 [DEBUG] Access Token not found.
2011-02-14 16:03:43 [DEBUG] BF-Navigate: http://touch.facebook.com/login.php?app_id=153555168010272&cancel=http%3A%2F%2Fwww.facebook.com%2Fco...
2011-02-14 16:03:43 [DEBUG] Access Token not found.
2011-02-14 16:04:25 [DEBUG] BF-Navigate: http://www.facebook.com/connect/uiserver.php?method=permissions.request&app_id=153555168010272&displ...
2011-02-14 16:04:25 [DEBUG] Access Token not found.
2011-02-14 16:04:42 [DEBUG] BF-Navigate: http://www.facebook.com/connect/uiserver.php
2011-02-14 16:04:42 [DEBUG] Access Token not found.
2011-02-14 16:04:43 [DEBUG] BF-Navigate: http://www.facebook.com/connect/login_success.html#access_token=153555168010272%7C5599e43893acc2e1f3...
2011-02-14 16:04:43 [DEBUG] access_token = 153555168010272%7C5599e43893acc2e1f37be67a-1334466193%7CDHwZKmK9rM004uVRfsROAQkt05Y
2011-02-14 16:04:43 [DEBUG] Access Token found !!!

 

 

What seems to happen on the Torch is that the BrowserField makes the initial request, but FB doesn't redirect it into the OAuth "client-side" flow, and instead redirects the Browser to the regular FB log in process.

 

I need some help here, I'm about at the limit of my expertise on this issue. If you have gotten this new FB SDK sample app to work, please let me know which device, and which device software versions, OS, Platform, bundle, etc... and note if you were on a physical device or sim.

 

Thanks.