0

I have a share button in my web page which is for sharing the post on facebook. Now the pop up opens up and when I click on post it does not close the pop-up. I have implemented this as mentioned in How do I close the popup after I post to facebook? .

I have used the below code for implementing the facebook feed

FB.ui({
    method: 'feed',
    link: shareLink,
    name: title,
    picture: picLink
}, function(response) {
    window.close();
});

FYI.. I am in development stage and I'm using a local server(localhost) and I have added this in the app settings at 'OAuth Settings' > 'Valid OAuth redirect URIs'

Community
  • 1
  • 1
Rohit
  • 11
  • 1
  • That code would close the window that `FB.ui` was called _from_, which makes little sense (unless that was already opened as a popup.) Normally, `FB.ui` should close its popups by itself again, so I don’t see why there would be any need to implement this yourself in the first place. (Unless you are using mobile Safari, which has a bug in regard to `window.close`, but that’s something every site has to deal or rather live with.) – CBroe May 18 '15 at 16:19
  • But for me the popup does not close by itself, and once I click on share or cancel i get redirected to to a blank page and the address shows the url https://www.facebook.com/v2.3/dialog/feed – Rohit May 19 '15 at 10:43
  • The Facebook JS SDK should handle this for you. Moreover, you shouldn't implement the code from the question you linked to, but instead try the code provided in the answers! – ifaour Jun 12 '15 at 13:56

0 Answers0