Facebook fb.ui dialog not showing up in Safari

It works fine on Firefox, Chrome and IE, but pops up on safari and is no exception and error. Tested a few safaris on different machines. By default, Safari blocks pop-ups. is there any way to unlock it automatically?

shareButton.on('click', function(e) {
    // do something
    shareAction();
}

function shareAction() {
    // do something
    share();
}

function share() {
    // do something
    submitShare();
}

function submitShare() {
    // do something
    // use the default fb.ui settings
    FB.ui({
    method: 'feed',
    name: 'Facebook Dialogs',
    link: 'https://developers.facebook.com/docs/dialogs/',
    picture: 'http://fbrell.com/f8.jpg',
    caption: 'Reference Documentation',
    description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
    },
    function(response) {
    if (response && response.post_id) {
      alert('Post was published.');
    } else {
      alert('Post was not published.');
    }
  }
);
}
+4
source share

Source: https://habr.com/ru/post/1538625/


All Articles