I'm implementing Fb JS SDK on PhoneGap to retrieve the user information, to log him in as well as to retrieve his list of friends.
Since a list of friends can be somewhat huge (?) is there any advantage for me to retrieve the facebook friends list on my server rather than on the phone with a (sometimes) slow connection ? I'm hesitating to implement this solution and would like to get some advice.
I've found a part of the answer here which is in favor of the JS SDK for the 2 following reasons:
- Less load on your server.
- Better response time as the request goes straight from the clients browser to Facebook, rather than from their browser => your server => Facebook, and back again.
But I'm still not convinced that for my case it still worth doing a call with the JS SDK and then transfer it to the server from the device/smartphone.
Thanks
EDIT: Here is the process flow I'm using with JS: we are in the case the user is not registered
The user wants to log in (phone) -> retrieve info from fb servers (fb servers) -> retrieve his id and send it to the servers (phone) -> check if the user is already registered (server) -> ask for more info to facebook like the friends list (phone -> fb server -> phone) -> register the user (server) ->log in and access the app (phone)
The reason why I'm doing 2 calls to the server is to ask for as few information to fb as possible if the user is already registered. Then ask for more if he isn't