08-20-2011 01:04 AM
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.
Solved! Go to Solution.
08-21-2011 06:28 PM
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
08-22-2011 12:34 AM
Hi , pls given me Facebook.java class or send getAccessTokenFromCode this methode.
Thanks.
08-22-2011 01:04 AM
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.
08-22-2011 04:27 AM
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
08-22-2011 09:31 AM
Your solution seems to have fixed it for me for now... Thanks
08-22-2011 09:36 AM
Hello guys,
If you used the Facebook SDK recommended on the BB site (http://us.blackberry.com/developers/started/facebo
08-22-2011 11:15 PM
Thx.. its working..
04-23-2012 10:34 AM
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
04-26-2012 01:48 PM
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..