I’m using the facebook JS API to get some information from users when signing in to a product I’m making.
My question is this – how can I perform a function after they have given the application permission to use their data?
I don’t see a callback function in their documentation, but figured there’s an easy way to do this. Basically, I want to show a loading image until they’ve authenticated. Then, if they’ve given me access, I’ll do some animation stuff.
Thanks!
Honestly, I’d steer clear of their JS SDK. It’s almost as bad as their PHP SDK. What they really want devs to do now is utilize the Open Graph. Then you can use cURL with PHP or Ajax or even simple redirects with URI parameters. That being said, with either application, you should receive an access token after the user accepts permission requests. Once you have the token, you can do whatever actions you need. You can create your own callback to handle this.
Easy Open Graph debugger: http://developers.facebook.com/tools/debug
Graph API Explorer – this helped me a ton when I was first starting with the OG development: http://developers.facebook.com/tools/explorer