We have a new project, building a fully featured facebook App on an embedded device (using Java) as a part of a new home automation system.
All is going well however we have hit a road block when it comes to adding friends. Our interface is a complete wrapper over the facebook UI (i.e. no browser). The only way I know how to add a friend is by sending a request to http://www.facebook.com/addfriend.php?id=XXXX
From here, the user is prompted to add a friend. The question is how should be go about wrapping up this request (i.e. mirroring it) so the user needs to click accept or deny and then forward this request off to Facebook?
AFAIK there is no API for adding friends… How can we go about mimicking this form and sending the request without having to implement a full browser? Space is also an issue so some clunky framework to try an emulate a browser window popup isnt going to work for us.
Any ideas and tips would be greatly appreciated.
Cheers!
You won’t be able to fake such a request without breaking Facebook’s CSRF protections, and if you did that the loophole would likely be closed almost immediately. If your app has an embedded browser there’s a Friends dialog you can use to send friend requests, and accept existing friend requests, but it won’t be trivial to simulate user logins and interactions with the dialog for security reasons