zyra / ngx-facebook

Angular TypeScript Wrapper for Facebook SDK
http://zyra.github.io/ngx-facebook/
MIT License
209 stars 70 forks source link

facebook title, description and image not displaying in facebook share #104

Open gnanavelshenll opened 7 years ago

gnanavelshenll commented 7 years ago

Hi,

I tried your ngx-facebook share package. But facebook title, description and image not displaying in facebook share.

Could please help with issue?. Thanks.

akhilesh2310 commented 7 years ago

const options: UIParams = { method: 'feed', name: 'Look at my performance!', link: window.location.href, picture: 'img url', description: 'Ya hoo', message: '', display: 'popup' }; this.fb.ui(options) .then((res: UIResponse) => { console.log('Got the users profile', res); }) .catch(this.handleError);

I am using this code to feed the post to Facebook however name, picture, description, message are not displayed in the post. Just link is visible.

michaelz commented 7 years ago

Same problem here. Facebook scrapes the site and uses the meta tags. Is the 'feed' method implemented?

michaelz commented 7 years ago

Okay, I managed to make it work like this

const params: UIParams = {
      method: 'share_open_graph',
      action_type: 'og.shares',
      action_properties: JSON.stringify({
          object: {
              'og:url': url,
              'og:title': 'OG Title',
              'og:description': 'OG Description',
              'og:image': url + '/assets/share/share_base.jpg',
              'og:image:width': '1200',
              'og:image:height': '630',
              'og:image:type': 'image/jpeg'
          }
      })

Source: https://stackoverflow.com/questions/44756939/with-picture-in-feed-dialog-deprecated-how-can-i-post-an-image-link

It looks like picture in the feed dialog is deprecated.

EDIT: width and height don't seem to work.

zeekay18 commented 6 years ago

thanks @michaelz. This worked for me

akshaybhagwat76 commented 5 years ago

Why this is not working for video objects.. Please help anyone.

const params: UIParams = { method: 'share_open_graph', action_type: 'og.shares', action_properties: JSON.stringify({ object: { 'og:url': url, 'og:title': 'OG Title', 'og:description': 'OG Description', 'og:video': 'http://www.youtube.com/v/k86xpd26M2g', 'og:video:width': '600', 'og:video:height': '350', 'og:video:type': 'video/mp4' } })