I am using facebook send method for invite friends in my website.
this is the code
function FacebookInviteFriends()
{
FB.ui({
method: 'send',
name: 'Join Stuffuneed',
picture: '<?php echo $this->getSkinUrl('images/owl_logo_250_250.jpg') ?>',
link: '<?php echo $customerLink?>',
description: "You have been invited to join Stuffuneed. Stuffuneed is the place to find the stuff you always needed but didn't know where to find",
});
}
it's showing me this dialog
problem is this
it's not showing me exact name.picture,link description.
i have also use og meta tags
<meta property="og:title" content="Join Stuffuneed" />
<meta property="og:image" content="http://www.stuffuneed.com/stuffuneed/skin/frontend/default/lockrez/images/owl_logo_25_250.jpg"/>
<meta property="og:site_name" content="Stuffuneed"/>
<meta property="og:url" content="http://www.stuffuneed.com/stuffuneed/"/>
<meta property="og:type" content="website"/>
but it's still showing me wrong content
Pls help me...
description picture are not the valid parameters in the send dialog. Reference
You'll just have to provide the link; and fb will fetch the image by itself. May be you can set the meta tag of og:image in the link you have provided.
Related
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" />
i added:
<meta property="og:title" content="This is a test title"/>
<meta property="og:description" content="This is a test decription of my shared link"/>
on the <head> part of my page but this is the outcome of my share.
what am i missing here to add a custom description and title for my share link?
I had the same problem, i came to find out that my meta for og:url wasn't right, i found this out by using the facebook debugger tool.
Input your page url and it will show you the information it could retrieve, or else it will tell you why it couldn't find the date
https://developers.facebook.com/tools/debug
when i use comment facebook plugin, then i'm comment in my site page. in my facebook timeline, i see
picture, title, url site, and description.
How to hide that's url site on facebook timeline ?
i'm not wrote <meta property="og:site_name" content=""/> there.
my code show below:
<meta property="og:title" content="<?php echo trim($title); ?>"/>
<meta property="og:description" content="<?php echo $desc;?>" />
<meta property="og:image" content="<?php echo $url_pic; ?>"/>
thanks
you can ommit the description but for users safety I dont think you can hide the sites url. it will allways be parsed from the page plugin is in.
You cannot hide the Site URL when sharing links on Facebook. It's a security feature so users know what domain they will be visiting.
I am using the following script to share links with Facebook:
<script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script>Share on Facebook
When facebook share screen popup opens it displayes title and description. I want to provide my own title and description of share are there parameters available for this?
Create a Facebook Application at http://developers.facebook.com/
Then embed Open Graph metatags in your document that describe to the Facebook document linter which title, image, description, and URL to use when shared.
Open Graph Documentation
Open Graph Debugger
Here is an example copied from the Facebook documentation that shows the Open Graph meta tags used to describe a website.
<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#
website: http://ogp.me/ns/website#">
<meta property="fb:app_id" content="YOUR_APP_ID">
<meta property="og:type" content="website">
<meta property="og:url" content="URL of this object">
<meta property="og:image" content="URL to an image">
<meta property="og:title" content="Name of blog">
<meta property="og:description" content="Description of object">
</head>
<body>
<!--a wonderful website -->
</body>
</html>
See http://developers.facebook.com/docs/share/ for more detailed view of the Facebook Share.
I think you can change the t= parameter to change the title of your share post on Facebook, not sure if you can change the description, I think the description comes from the meta Description of the page you are sharing.
I'm building a facebook iFrame application that uses facebook comments. When a user leaves a comment the default action is that this comment will be posted to their wall. The wall post is something along the lines of
UserX commented on example.com
# the comment text goes here
http://example.com
apps.facebook.com
You should be able to include an image, a description, and set the link to be the title of the page (where it says http://example.com above the apps.facebook.com), but I'm having no luck getting this to work.
I thought it would grab the information from my meta tags (as long as they included the appropriate 'og' tags), but that isn't working. Nor am I able to define values for title, url, image etc. in the same way that you can for normal wall posts.
Anyone have any idea how to get this working??
EDIT:
Here are the meta tags I currently am using.
<meta property="og:title" content="USERNAME'S PAGE" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://example.com"/>
<meta property="og:image" content="http://example.com/images/wall-post.png" />
<meta property="og:description" content="Some description goes here." />
Use URL Linter to Debug
http://developers.facebook.com/tools/lint/
Make sure all meta tags are correct and if you've made some changes, it takes some time to update for facebook and here's a sample, this is a working version:
<!doctype html>
<html xmlns:og="http://ogp.me/ns#"
xmlns:fb="https://www.facebook.com/2008/fbml" lang="en">
<head>
<meta charset="utf-8">
<title>Facebook Comment Box Sample</title>
<meta property="og:title" content="YOUR-POST-TITLE"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://YOUR-SITE-URL"/>
<meta property="og:image" content="http://YOUR-IMAGE-URL"/>
<meta property="og:site_name" content="YOUR-SITE-TITLE"/>
<meta property="og:description" content="YOUR-DESCRIPTION"/>
<meta property="fb:admins" content="YOUR-USER-ID"/>
</head>
<body>
<h1>Facebook Comment Box:</h1>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:comments href="http://YOUR-SITE-URL" num_posts="10" width="500"></fb:comments>
</body>
</html>
OK, after a lot of stumbling around I figured this out.
My iFrame application requires facebook authentication before accessing the application (as I believe all facebook apps do). This means that the facebook crawlers were unable to crawl my homepage and pick up the og: meta tags.
To solve this I first had to figure out what the facebook crawler looks like. I logged the HTTP_USER_AGENT for all requests and then used the facebook URL Linter (http://developers.facebook.com/tools/lint/) to ping my site.
The facebook crawler identifies itself as "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
Once I had that I was able to just add a little conditional logic to let the crawler bypass authentication and access my site. I hope this helps others.
First I made sure I had all my meta properties set, then I just put my code in this:
if (strpos($_SERVER['HTTP_USER_AGENT'],"externalhit_uatext")<5)
{
}