No image is displayed when sharing on Facebook

0

Hi, I am using the Angular Socialshare library and when you share on Facebook, the image is not displayed, you can simply see the text of the content on the page, this is the code ...

<a href="" 
  socialshare 
  socialshare-provider="facebook"  
  socialshare-type="feed"
  socialshare-via="1740491275981023" 
  socialshare-media="http://ip:3001/images/logo.png"
  socialshare-text="Caso Relevante"
  socialshare-caption="PC"
  socialshare-url="http://ip:3001/operador"
  socialshare-quote="720kb Angular-Social-Share"
  socialshare-hashtags="#Saludos"
  socialshare-popup-height="300" 
  socialshare-popup-width="400"                            
  socialshare-trigger="click">
  <img src="../../images/facebooklogo.png" style="max-width: 1.5%" >
</a>

I do not know if I'm missing any label or settings so you can see a preloaded image. or will it be that I access by ip so it does not show me a previous image?

    
asked by Alberto Rojas 08.08.2017 в 00:43
source

2 answers

2

Angular SocialShare version after April 2017

As of April 2017 the socialshare-media attribute was removed to indicate the image that appears in the Facebook share. If this is your case you should use the OpenGraph goals to set the image that will be seen in the share. The goals are labels that are established to the web page in question (in your case the link of the )

You can see the notice in the README of the project in the facebook section.

Angular SocialShare version before April 2017

Could http://ip:3001/images/logo.png be your local ip for development?

Think that the image you indicate has to be accessible by facebook , so in development environments if you indicate your local ip or the internal ip of the development server Facebook can not access the image and therefore will not show it when you try to share such content.

    
answered by 08.08.2017 в 08:31
0

According to what you must pass the route of the complete image to facebook, so http://ip:3001/images/logo.png is not valid. it should be:

<meta property="og:image" content="http://static01.nyt.com/images/2015/02/19/arts/international/19iht-btnumbers19A/19iht-btnumbers19A-facebookJumbo-v2.jpg" />

here is the facebook debugger so you can see it in real time: Shared content debugger Facebook

    
answered by 28.08.2018 в 03:11