share on facebook not working on iphone

Asked

Viewed 29 times

0

I made a button to share on Facebook, when clicking it opens the Facebook UI window, but is not working on iPhone.

I don’t have an iPhone to test and I’m having trouble finding the error.

Follow the code I’m using:

function shareDialog() {
    var url = window.location.href;
    var title = $("meta[property='og:title'").attr('content');
    var description = $("meta[property='og:description'").attr('content');
    var imageUrl = $("meta[property='og:image'").attr('content');

    FB.ui({
        method: 'share_open_graph',
        action_type: 'og.shares',
        hashtag: '#kimaneiro',
        action_properties: JSON.stringify({
            object : {
               'og:url': url,
               'og:title': title,
               'og:description': description,
               'og:image': imageUrl,
               'og:width': 1200,
               'og:height': 630,
            }
        })
      },
      // callback
      function(response) {
        if (response && !response.error_message) {
          // 
        } else {
          //
        }
      }
    );
}

$(".Btn--facebook-share").click(shareDialog);

Does anyone have any idea what might be going on?

  • Might not be something related to the height and width you set up ?

  • Without the height and width, it tbm does not work :/ and on android that ta working, gets a small square

  • Try using percentage and take a test.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.