video post on timeline not playing inline - facebook

I have a problem when posting video through my app on users with TimeLine profile.
the post appears very small and when clicked the video opens on a new tab instead of playing inside facebook.
Here are some details :
I'm building an application that create customized videos (SWF) and post them on a user's friend wall.
I'm "wrapping" the SWF file in an HTML file that include the following "meta og:" tags -
<meta property="fb:app_id" content="******" />
<meta property="og:url" content="THIS PAGE URL" />
<meta property="og:title" content="Title" />
<meta property="og:description" content="some description" />
<meta property="og:type" content="video" />
<meta property="og:image" content="an img url" />
<meta property="og:video" content="URL TO THE SWF FILE" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:video:width" content="396" />
<meta property="og:video:height" content="297" />
<meta property="og:site_name" content="pickle-games" />
and then in the body i embed the SWF using the "embed" tag.
You can see an example by viewing the source of http://pickle-games.com/BigBully/hitVideo.php?hit_id=1327242593&hit=hit2
I'm using the facebook PHP SDK to post on the wall like this :
$facebook->api("/" . $uid . "/feed", "POST",
array(
'link' => $server_url . 'hitVideo.php?hit='. $hit . "&hit_id=".$hit_id ."&u_name=" . $u_name . "&f_name=". $f_name
));
When posting on a user with the old profile (not the timeline) everything works fine and the video plays inline, on the wall.
The problem, as mentioned above, is only when posting on a user that uses the TimeLine profile
BTW - if i share the link manually (not through my app) on the friend's timeline then everything works fine...
What am i missing?
How do i post it through my app in a way that it will work also on the timeline?
Thanks.

Try this
$attachment = array(
'message' => 'SOMETHING HERE!',
'name' => 'name!',
'caption' => 'caption!',
'link' => 'http://link.com',
'description' => 'description here!',
'access_token' => $request["oauth_token"],
'picture' => 'http://link.com/image.jpg',
'source' => 'link.com/flash.swf',
'actions' => array(array('name' => 'some action',
'link' => 'https://link.com/'))
);
$result = $facebook->api('/'.$friend_id.'/feed/','post',$attachment);
It is very important to put something in the 'message' or else is going to give you that same error...

Just a note, if you do not have
<meta property="fb:app_id" content="xxxxxxxxxxxxxxxx" />
When posted to the wall, the video will open in a NEW window.

Related

How to share same image on messenger and facebook via meta tags Angular?

I am dealing with problem of sharing same image on messenger and facebook in Angular PWA app. Whole thing is done using tags in html. The problem is in size of image, the photo is in recommended size for Facebook 1200x630px and it shows correct. While i am sharing it via messenger it is cut, maybe there should be another image or I didnt configure it correctly. I also set width and height of image using meta.
Here's code:
<meta property="og:title" th:content="${title}">
<meta property="og:url" th:content="${url}" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="here is site name" />
<meta property="og:image" content="here is photo url" />
<meta property="og:image:width" content="600" />
<meta property="og:image:height" content="314" />
<meta property="fb:app_id" content="here is facebook app id" />
I have a component with shared buttons and messenger is using function from FB docs.
shareOnMessenger() {
window.open('fb-messenger://share?link=' + encodeURIComponent(this.detailedViewURL) + '&app_id=' + encodeURIComponent(this.facebookMetaTag.content));
}

Post a facebook page/feed with image using graph api

I'm struggling to post a facebook page/feed with a image.
I'm following all the documentation but, damm :(, it's not working
https://developers.facebook.com/docs/graph-api/reference/v2.10/page/feed#publish
using the object_attachment to pass and upload photo id.
I've tried with an already uploaded image and a new upload but
Nothing appears to work
If i run this, all works as expected but the image does not work
$args = array( 'access_token' => $pag_access_token,
'message' => $description,
'object_attachment' => $photoID,
'link' => $link);
$status = $facebook->api("/$facebookUsername/feed", 'post', $args);
Note: $photoID is a valid facebook photo.
Result:
Any thoughts??
Update: SOLUTION
Thanks to #Norbert insights heres how we can accomplish that:
Using the Graph api we need to pass the access_token, the link (important) and a description (optional)
On the api endpoint, i was just sharing the message and the link to my frontend page.
$args = array( 'access_token' => $pag_access_token,
'message' => "option text",
'link' => $options['link']);
$status = $facebook->api("/$facebookpage/feed", 'post', $args);
With the above code you will be able to share to facebook feed your message, but without the title of your post and the image.
To do that you will need to add the following metadata into your destination page ($link that was shared)
2.
<meta property="og:url" content="YOUR URL">
<meta property="og:type" content="website">
<meta property="og:title" content="URL TITLE">
<meta property="og:description" content="SMALL DESCRIPTION">
<meta property="og:image" content="http://IMAGE SERVED WITH HTTP">
<meta property="og:image:secure_url" content="https://IMAGE SERVED AS HTTPD">
if the url you want to share is served over https you must also include the og:image:secure_url
They need to be served under the same protocol.
Hope this help everyone with the same problem.
Regards

Sending a "like" request to Facebook without the og tags in <head>

I am trying to post stories like "John likes a photo at example.com", I was able to trigger it by using the og tags in the url area:
<meta property="fb:app_id" content="398192236928167" />
<meta property="og:title" content="Sample Title" />
<meta property="og:image" content="http://www.example.com/photo_large_thumbs/6396.jpg" />
<meta property="og:url" content="http://www.example.com/6396" />
<meta property="og:type" content="myappname:photo" />
This only works from PHP code if I post it as an "object" and the only value I provide is the URL containing the above tags.
$response = $facebook->api("/me/og.likes", "POST", array('object')=>'http://www.example.com/6396');
Can I send the title, image, etc in the request (array) ? If so, how should the keys be formatted?

Facebook feed dialog posts don't re-share (repost) correctly

I have facebook feed dialogues successfully setup up for my application using the Facebook UI method, but I'm getting some odd behavior when another user tries to use the "Share" link on Facebook. The content for this re-share is not the same content initially shared and appears to be a snippet of javascript.
This is my current feed dialogue code:
FB.ui({
method: 'feed',
redirect_uri: link.attr('href'),
name: "Check out this image on WorkHands",
picture: link.closest('.thumbnail').find('.featured-image').attr('src'),
link: link.attr('href'),
caption: 'Work by' + link.closest('.thumbnail').find('.project-creator').text(),
description: link.closest('.thumbnail').data('description'),
display: 'popup'
}
Which yields something like this:
However, as soon as it's shared on Facebook, the dialog looks like this:
I can only think that this must have something to do with the metatags on the page?
Currently the meta-tags are a little different than the ones being created for the feed dialog:
<meta content="103896" property="fb:admins" />
<meta content="WorkHands" property="og:site_name" />
<meta content="website" property="og:type" />
<meta content="Project by Ron Andrade" property="og:title" />
<meta content="https://www.workhands.us/images/78a98834-59fa-48c7-8d93-8ffaa0a75811" property="og:url" />
<meta content="https://www.workhands.us/assets/work-hands-logo-595.png" property="og:image" />
<meta content="WorkHands is for workers in construction, plumbing, welding, landscaping, electrical, masonry, HVAC, automotive, trucking, and other skilled trades." property="og:description" />

Wordpress thumbnail and meta data being ignored when posting to facebook wall

I'm having a problem that I can't seem to figure out, though I'm not sure if I'm on the right track. Can anyone please advise?
I've just created a wordpress website, that post's will be shared on facebook.
I'm using featured images and I would like my featured image facebook thumbnail to be used.
It seems when I post a link to facebook, facebook just picks up images on the page and you can choose a thumbnail.
I'm not really up for that because the images are landscape and don't look good. So I started looking into meta tag with the open graph property to see if I could dynamically populate the content that facebook captures when posting a link to the wall.
This is what I tried...
<meta name="description" content="" />
<meta name="author" content="" />
<meta charset="utf-8" />
<meta property="fb:app_id" content="0000000000000000" />
<?php if ( is_single() || is_page() ) { ?>
<meta property="og:title" content="<?php echo get_the_title(); ?>" />
<meta property="og:type" content="article" />
<meta property="og:url" content="<?php echo get_permalink(); ?>" />
<meta property="og:image" content="<?php $fbthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'facebook-thumb' ); echo $fbthumb[0]; ?>" />
<meta property="og:site_name" content="myblog.co.uk"/>
<meta property="og:description" content="<?php echo get_the_excerpt(); ?>" />
<?php } ?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
But all of this is ignored!!!
Can anyone help me understand how to control the content facebook draws in via a link being posted to a wall. I would appreciated your help very much.
Thanks
I had this problem the other day. Facebook wants og:images to be larger than 200px in both directions, or it will ignore them. I found I got the best result when I used wp_get_attachment_image_src($img.ID, 'large')
Have you tried looking at your site with the Facebook Debugger to see what it has to say about your site? https://developers.facebook.com/tools/debug