As commented elsewhere, a synchronous call is useful if you want to open a pop-up after a successful response, since browsers often block pop-ups that are not the result of direct user action.
You can do this by manually using the Open Graph API with JavaScript (or jQuery according to the example below), and not using the Facebook JS SDK.
eg. upload a photo via the Open Graph API, and then ask the user to add it as an image of their profile using a pop-up window without blocking the pop-up window:
$.ajax({ type: 'POST', url: 'https://graph.facebook.com/me/photos', async: false, data: { access_token: '[accessToken]',//received via response.authResponse.accessToken after login url: '[imageUrl]' }, success: function(response) { if (response && !response.error) { window.open('http://www.facebook.com/photo.php?fbid=' + response.id + '&makeprofile=1'); } } });
Alasdair mclay
source share