Facebook session proxy revisited.
This is not the question, but an answer, that I found after having to browse through the java source code. I hope it will be helpful to someone, and maybe the appcelerator team, after reading it, will take some steps to fix the issue, or at least document it.
After reading the answer to the following question, I was happy, because the proxy worked with iphone:
http://developer.appcelerator.com/question/32801/facebook-session-proxy-again
However, after trying it on Android simulator, it just crashed after trying to log in.
Well, the thing is that
THE DEFAULT RESPONSE FORMAT FOR FACEBOOK IS XML *
ANDROID DOESNT SUPPORT XML, BUT ONLY JSON *
Facebook does give you an option to receive JSON in the response, so we need to add one more parameter "format" to our parameters, for the proxy to work with Android:
$post = array('method' => 'facebook.auth.getSession',
'api_key' => $appapikey,
'v' => '1.0',
'format' => 'JSON',
'auth_token' => $_GET['auth_token'],
'generate_session_secret' => 1);
However, this doesnt work on iphone!!!
Looks like the iphone version of Facebook module doesnt expect JSON!!!
So for iphone you'll need the original version of proxy, or I dont understand something (maybe, you'll need a parameter, or I dont know), and for the android, u'll need to request facebook response in json format.
2 Answers
-
Can you post your full proxy code. I made the suggested change and I'm still getting a blank login screen.
Thanks in advance.
-
Can you post your full proxy code. I made the suggested change and I'm still getting a blank login screen.
Thanks in advance.