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
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: Facebook BlackBerry SDK 0.8.25 Released

@ebaskoro:

 

I based my sugestion ths was old source becuase of the contents of facebook.java, specifically:

getAccessTokenFromUrl(..)

 

In a previous post you suggested a fix for this method, which does not seem to be in the new source. 

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

 

Does your attachment include this fix?  I looked and it appears not.

Developer
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Facebook BlackBerry SDK 0.8.25 Released

Looks like I found one workaround for 6 OS devices - check access token in URLs from ConnectionFactory.getConnection() also.

 

But other cases don't work.

 

Thanks,

Eugen

New Developer
Posts: 27
Registered: ‎11-03-2009
My Device: 8320
My Carrier: XL

Re: Facebook BlackBerry SDK 0.8.25 Released

@peter_strange: The change that was introduced in the minor release is not the same as the code I posted. Below is the diff.

 

Index: Facebook.java
===================================================================
--- Facebook.java	(revision 144)
+++ Facebook.java	(revision 145)
@@ -748,7 +748,7 @@
 	protected class LoginScreen extends BrowserScreen {
 
 		protected LoginScreen() {
-			super("https://www.facebook.com/dialog/oauth?scope=" + appSettings.getPermissionsString() + "&redirect_uri=" + appSettings.getNextUrl() + "&display=wap&client_id=" + appSettings.getApplicationId() + "&response_type=code", lcf, LOADING);
+			super("https://www.facebook.com/dialog/oauth?scope=" + appSettings.getPermissionsString() + "&redirect_uri=" + appSettings.getNextUrl() + "&display=wap&client_id=" + appSettings.getApplicationId() + "&response_type=token", lcf, LOADING);
 		}
 
 		protected boolean hasAccessToken(String pUrl) {

We basically changed the response_type parameter from code to token which in effect changed the OAuth authentication mode from server-side to client-side.

 

Very sorry for the confusion.

 

Cheers.

EB

 

Developer
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Facebook BlackBerry SDK 0.8.25 Released

@ebaskoro: Does FSDK works for your 6 OS device when you remove app permissions/remove app from trusted list?

 

Does it work for 5 OS devices right now?

 

Thanks,

Eugen

Contributor
Posts: 30
Registered: ‎06-22-2010
My Device: bold 9700
My Carrier: airtel

Re: Facebook BlackBerry SDK 0.8.25 Released

[ Edited ]

Eugen,
Connection factory has implemented already for browser field in FB SDK.

I can get the ConnectionFactory while using WIFI. But I'm getting null while using SIM.

 

 

 

public class LoggableConnectionFactory extends ConnectionFactory {

    protected Logger log = Logger.getLogger(getClass());

    public ConnectionDescriptor getConnection(String url) {
        ConnectionDescriptor connd = super.getConnection(url);
        logConnection(connd);
        return connd;
    }

 

Developer
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Facebook BlackBerry SDK 0.8.25 Released

There are next transports combination:

	protected int[] preferredTransportTypes = { TransportInfo.TRANSPORT_TCP_WIFI, TransportInfo.TRANSPORT_TCP_CELLULAR, TransportInfo.TRANSPORT_WAP2 };
	protected int[] disallowedTransportTypes = { TransportInfo.TRANSPORT_BIS_B, TransportInfo.TRANSPORT_MDS, TransportInfo.TRANSPORT_WAP };

It means if your operator requires APN settings for TCP, WAP you will get null descriptor or timeout in current implementation. Please read more about transport types and BB connection model.

 

Thanks,

Eugen

Contributor
Posts: 30
Registered: ‎06-22-2010
My Device: bold 9700
My Carrier: airtel

Re: Facebook BlackBerry SDK 0.8.25 Released

Thanks Eugen,

I'm passing null for setPreferredTransportTypes, Its working fine

 

 

Thanks

RazeBond

Developer
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Facebook BlackBerry SDK 0.8.25 Released

Nice! But can someone reply to my answers? :smileyhappy:

New Developer
Posts: 27
Registered: ‎11-03-2009
My Device: 8320
My Carrier: XL

Re: Facebook BlackBerry SDK 0.8.25 Released

Eugen, I tried running the Demo app using 8900, 9800, 9930 simulators by deauthorising the app prior running it and it worked fine. In addition, for 9930 in particular I had to choose 2G/3G instead of the default EVO to avoid using MDS TransportInfo.

 

Cheers.

EB

Developer
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Facebook BlackBerry SDK 0.8.25 Released

Thanks a lot for reply!

 

Shame on me that I didn't ask question corrrect. That's correct! Simulators work perfectly except that real devices don't.