FB.UI feed dialog not closing after sharing

312 views Asked by At

I have successfully implemented the Facebook share feature but the dialog/pop up is not closing after sharing the post. My HTML code is :

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({
    appId  : '{MY - API KEY}',
    status : true, 
    cookie : true, 
    xfbml  : true  
  });
</script>
<input type="button" id="sendMessage" value="Send Message" />

My JS Code is :

$(document).ready(function() {
     $('#sendMessage').click(function () {
       FB.ui({
             method: 'feed',
        name: 'Join Play and Win',
        link: 'valid link here',
        picture: 'valid image url here',
        caption: 'Reference Documentation',
        description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
        }, function(response) {
  if (typeof response != 'undefined') {
          alert('Thanks for sharing');
        }
        });
});
});

I have tried using self.close(),window.close() and node.close().

Any help will be much appreciated. Thank you.

0

There are 0 answers