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
shahumang8
Posts: 671
Registered: ‎08-09-2010
My Device: Not Specified
Accepted Solution

Facebook SDK not working from 2 days.

Hello,

 

       I implemented facebook sdk in my apps but there are no any response means i login to facebook at that time the redirect to success page but then then not close means at that time 400 {Bed Request}  error throw thus there are no any option to know that if it's work or not.And i also mail to Facebook but there are no any reply this work before 2 days so i am very tired to search it.

 

So help me.

 

 

Thanks.

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

Re: Facebook SDK not working from 2 days.

I believe your issue is related to the fact that Facebook changes its returned code parameter after login. You can easily fix this in Facebook.java by replacing the method getAccessTokenFromUrl(String) : String by the following.

 

Let me know if it solves it. We are going to issue a fix in the next minor release.

 

protected String getAccessTokenFromUrl(String url) {
  String code = null;
  String at = null;

  if ((url != null) && !url.trim().equals("")) {
    int startIndex = url.indexOf("#access_token=");

    if (startIndex > -1) {
      startIndex++;
      int stopIndex = url.length();

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

      at = url.substring(url.indexOf('=', startIndex) + 1, stopIndex);
    } else {
      startIndex = url.indexOf("?code=");

      if (startIndex > -1) {
        startIndex++;
        int stopIndex = url.length();

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

        code = url.substring(url.indexOf('=', startIndex)+1, stopIndex);
        at = getAccessTokenFromCode(code);
      }
    }
  }

  return at;
}

 

Cheers.

EB

 

Developer
shahumang8
Posts: 671
Registered: ‎08-09-2010
My Device: Not Specified

Re: Facebook SDK not working from 2 days.

Hi , pls given me Facebook.java class or send getAccessTokenFromCode this methode.

 

Thanks.

Developer
shahumang8
Posts: 671
Registered: ‎08-09-2010
My Device: Not Specified

Re: Facebook SDK not working from 2 days.

Hi dude,

 

       Today i try it but same error throws so i think taht this problem from  Facebook because i login at that time browser page come and after they redirect to Success page so Success page also come and that time one url call for get the AccessToken.so this accessToken not get at that time and given me one message that this is invalidate formate and i copy url this and show in browser at that time given me reply to 200 and also get the AccessToken so i think this problem to Facebook because befor few days ago this work fine.And also i mail to Facebook but there are no any response so i am very tired for this.

 

Thnaks. 

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

Re: Facebook SDK not working from 2 days.

Very sorry to hear about your frustration. One you can do to help us help you is to paste the information displayed in the console when debugging you project. The SDK should print out the URLs involved during the authentication and authorization processes. Please paste it here so we can all have a look at it.

 

Cheers.

EB

Developer
IK828
Posts: 132
Registered: ‎11-20-2009
My Device: Not Specified

Re: Facebook SDK not working from 2 days.

Your solution seems to have fixed it for me for now... Thanks

Visitor
Mobindus
Posts: 1
Registered: ‎08-19-2011
My Device: I'm a developer

Re: Facebook SDK not working from 2 days.

Hello guys,

If you used the Facebook SDK recommended on the BB site (http://us.blackberry.com/developers/started/facebook.jsp), please check the following link - they fixed the issue and updated the SDK (http://sourceforge.net/projects/facebook-bb-sdk/files/).

 

 

New Contributor
yoginih
Posts: 9
Registered: ‎08-22-2011
My Device: 9700

Re: Facebook SDK not working from 2 days.

Thx.. its working..

New Developer
vbergae
Posts: 5
Registered: ‎03-06-2012
My Device: BB

Re: Facebook SDK not working from 2 days.

Hi all,

 

I've the same problem with the last version published (0.8.25) which is supposed to fix this trouble, but I tried in OS 5, 6 and 7 and the execution halts on "Success" white screen and callback methods aren't called.

 

Has somebody more actual experience on FB SDK? Project appears to be stopped from August 2011.

 

Thanks for your time,

Víctor

Visitor
juani23
Posts: 1
Registered: ‎04-26-2012
My Device: BlackBerry 9930

Re: Facebook SDK not working from 2 days.

Hi all...

 

I have a problem with the Facebook sdk..

Whenever i try to do anything with a class related to facebook i get that eclipse could not find the source.. This happens with every class from the facebook jar

ideas?

I have already exported the jars to my project, but when i want to open any of them i get the same error, source not found...

 

thx in advance..