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
IK828
Posts: 132
Registered: ‎11-20-2009
My Device: Not Specified
Accepted Solution

Facebook SDK problems

Hey

 

Yesturday the Facebook SDK and strawberry was working perfectly fine for me. I am using it today and it seems like http://m.facebook.com/login has changed, and when you successfully login it is no longer forwarding to the same page as yesturday. In addition, it seems like the new page is not giving a auth_token? 

 

Can anyone try their strawberry project (or facebook SDK that used to work) and log in and see if they are having the same problem?

 

Thanks

Please use plain text.
Developer
jprofitt
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: Facebook SDK problems

Hmm, I'm getting a page that says "Success" but it isn't appearing to tell my app that I've logged in like it used to.

Please use plain text.
Developer
IK828
Posts: 132
Registered: ‎11-20-2009
My Device: Not Specified

Re: Facebook SDK problems

Exactly,

 

upon closer examination, it looks like in the LoginScreen.java at the following code

	public void onAction(Action event) {
		if (event.getSource() == this) 
		{	
			if (event.getAction().equals(ACTION_SUCCESS) && getUrl().startsWith(settings.nextUrl)) {
				String url = getUrl();
				log.info("(LoginScreen.ACTION_SUCCESS) URL: " + url);
				int startIndex = url.indexOf("auth_token");
					
			if (startIndex > -1) {
							
					int stopIndex = url.length();

					if (url.indexOf('&', startIndex) > -1) {
						stopIndex = url.indexOf('&', startIndex);
					} else if (url.indexOf(';', startIndex) > -1) {
						stopIndex = url.indexOf(';', startIndex);
					}

					String authToken = url.substring(url.indexOf('=', startIndex) + 1, stopIndex);
					log.debug("auth_token = " + authToken);
								
					fireAction(ACTION_LOGGED_IN, authToken);
				}
			}
		}
	}

 

the url does not contain "auth_token" in it, and as a result it never fires the fireAction(ACTION_LOGGED_IN). 

 

Does anyone know how to fix this or a work around?

 

Please use plain text.
Contributor
joseantv
Posts: 15
Registered: ‎12-28-2010
My Device: Not Specified

Re: Facebook SDK problems

I have the same problem!

I download the Facebook SDK from sourforge and it's the same, without changes:

http://sourceforge.net/projects/facebook-bb-sdk/files/

 

I get the "Success" screen and the program (Strawberry) stop in it.

 

Have somebody any solution?

Please use plain text.
Developer
jprofitt
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: Facebook SDK problems

Figured out what might be a workaround (haven't fully tested yet). Instead of calling the login screen before the permissions screen, just call the permissions screen. It will redirect you to the Login page and then might be working after that. Going to test out the functionality now.

Please use plain text.
Developer
IK828
Posts: 132
Registered: ‎11-20-2009
My Device: Not Specified

Re: Facebook SDK problems

jprofitt let me know if that approach works for you, so far none of mine are working out too well.

Please use plain text.
Developer
jprofitt
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: Facebook SDK problems

False alarm. But I think I'm closer to understanding what to do to fix this. The login_success.html page should be redirected to login_success.html#access_token=.... but the BrowserScreen doesn't have the extra bits at the end, just login_success.html. Trying to find out where it parses through the URLs and have it include the entire URL.

Please use plain text.
Developer
IK828
Posts: 132
Registered: ‎11-20-2009
My Device: Not Specified

Re: Facebook SDK problems

Anyone have any luck with fixing this issue? This pretty much screws up the Blackberry SDK...

Please use plain text.
Developer
jonberry
Posts: 484
Registered: ‎07-17-2008
My Device: Not Specified

Re: Facebook SDK problems

The facebook part of our app isn't working anymore either.

 

I knew this was going to happen...

 

These 3rd party APIs always have problems when things change.

 

I don't know why RIM couldn't just release a decent API for facebook.

Please use plain text.
Contributor
joseantv
Posts: 15
Registered: ‎12-28-2010
My Device: Not Specified

Re: Facebook SDK problems

Facebook said something? because I have been watching in Facebook and nobody said it.....

Does anyone know an alternative method?

Please use plain text.