Facebook Like button in Page Tab App - php

I've seem to have run into an issue here.
I have a voting/gallery app on a Tab of a specific page on Facebook.
So to provide a user with a direct link to a image in a Gallery(in the Paget Tab App), i generated a URL with APP_DATA, so I can pass data(image filename)to the iframe.
So basically my links look kinda like this:
https://www.facebook.com/pages/xxxxxx/xxxxxxxxx?sk=app_xxxxxxx&app_data=showimage.php%3Ffilename%3D1336314789stevakralj%2Ejpg
Now, when I try to create a Like button for this Link, I get nothing.
Any ideas?

I have exactly the same problem... In my app, which is hosted by a page tab, the "Like" buttons for each item apper correctly and the "data-href" attribute for each "like" button has the same format as yours, but EVERY like button points to the Facebook page which hosts the app, not to the individual item... so, for every item in my gallery, the "like" information under it is exactly the same (number of likes for the page hosting the app) and if I "dislike" any item, I "dislike" the entire page.
I have tried the same format but the parameter NOT on a facebook page... then it works... I don't see a difference but:
https://www.facebook.com/pages/xxxxxx/xxxxxxxxx?sk=app_xxxxxxx&app_data=abc (DOESN'T WORK, for each item which have app_data different)
https://www.mytestweb.com/test.aspx?sk=app_xxxxxxx&app_data=abc (WORKS for each item which have app_data different)

Facebook doesn't seem to allow linking directly to a tab page so strips your app ID from the URL. There's no way to get around this except by linking to an external site that bounces back to Facebook.

Related

Adding a facebook page tab using Facebook PHP SDK v5

I have created a facebook application. Using php code to adding a tab in the Facebook page. And I want to change 'Secure Page Tab URL' for tab on the same App but I don't know how to do it!
Example:
tab A -> Secure Page Tab URL A / tab B -> Secure Page Tab URL B
Does any one have an idea about this? thanks!
You can only have one Secure Page Tab URL per App. If you want to show different content on different Pages, you have to parse the signed_request POST parameter to get the Page ID - and show different content depending on that ID.
More information: https://developers.facebook.com/docs/games/gamesonfacebook/login#parsingsr
Btw, it is not possible to add one App several times to one Page, just in case that´s what you want to achieve.

when doing a 'like' on one of our page, the 'like' is posted twice

We just implemented a Facebook like button everywhere on our site. However, it works a little bit weird on one of the pages.
If you click on the like button anywhere and then write a comment, it only posts once on Facebook. This is the correct behavior.
Unfortunately, on the another page it creates two items on your Facebook wall.
Has anybody previously seen the same problem on any site?
I use an iframe, and the link is what I call there:
www.facebook.com/plugins/like.php?href=%s;send=false&layout=standard&show_faces=false&;action=like&colorscheme=light&font=arial&height=35&appId=%s
The first %s is the current URL, the second %s is an appid.
Its a common bug, ive got a facebook like box too. And when i like my own page it will be liked twice. You cant do anything about it. Other visitors who like your page will only show up once.

Personalized fanpage Tab

I'm trying to make a fanpage with the name and company of those who visit using PHP.
I managed to program it and add it to my page. But only appears if you have already added the the app before you visit.
I need to order installation of the app when the user enters the page.
how can i do this?
page http://www.facebook.com/pages/RMG-Direct/101016389955224?sk=app_246899652058808
This stumped me for a while too when the made some changes back in December I believe. One solution I found helped me was to make a link on the page which creates a popup that lets you add the tab to a page.
<a href="#" onclick=window.open("http://www.facebook.com/dialog/pagetab?app_id=YOUR APP ID HERE&next=YOUR APPS URL HERE","PageTab","width=800,height=500");>Add app to Your Page!</a>
and then refresh your browser & click it, and after you've added it to the page you can remove it again.

How does the Facebook 'share' button on Stack overflow work?

I am looking to add social icons to our site, giving customers the ability to "like", tweet and share content on their facebook and twitter profiles. I have noticed to the left of this box, the facebook and twitter icons do exactly what I am trying to accomplish but I am not familiar with how to do this. Looking at the source code, there are JS references to:
<script type="text/javascript">
StackExchange.ready(function() {
var shareUrl = "http%3a%2f%2fstackoverflow.com%2fq%2f7505636%2f337690";
var shareMsg = "Advice+integrating+Facebook+%27share%27+and+link%2fimage+capabilities+with+our+site";
StackExchange.share.facebook($("#fb-share-7505636"), shareUrl, shareMsg);
StackExchange.share.twitter($("#twitter-share-7505636"), shareUrl, shareMsg);
});
</script>
Our site works this way: While anybody can visit the primary site at any time, individuals can sign up as representatives with their own unique URL that acts as a referrer to give 'credit' on rewards. I have reviewed the facebook developer site and to be honest I am slightly overwhelmed. I want to give our members the ability to click a Facebook icon from within their dashboard, prompting them to post on their wall with a set image, set title, and description. I have read in the documentation this is done by setting meta tags in the head but it does not seem to matter for my site (or I am clearly doing it wrong).
What if the URL facebook is looking for (share URL) is behind a password protected page or an area of the site which would not allow content based on a missing PHP SESSION variable?
Edit
I have also seen a lot on the net which says I have to integrate the Facebook JS SDK but then goes on to talk about authentication/permission to write on walls, etc. Yes the link to the left does not ask for permission to do anything other than to 1) log into the FB account, 2) post on the user's wall.
This site is a perfect example
The link above is great but it assumes I need to authorize a 'share' which does not occur on this site.
When you click on the share button, you call a script on facebook.com that will then in turn access the page pointed to in the querystring (?u=xxxxxx).
Facebook will parse that page and grab the first few images it finds, a description and title from the page. That is what it shows to you and allows you to add some additional text (as well as edit the title/description/and choose different images).
If that page contains the specific meta tags that facebook asks you to add to the page, then they'll use those to populate the title/description/image. This allows the webpage author to control how their page shows up in a facebook feed (although the user could still edit it before posting). These meta tags would need to be in that particular page to be used by facebook.
If facebook cannot access the page because it's password protected, etc. - then it cannot parse the meta tags and will then just show the user the URL as the title with no description and thumbnail.

Share multiple items on facebook

I need to build a page with 2 different facebook share instances.
- there is a video i want the end-user to be able to share on his/her profile.
- and then, there is the page itself, which i'd like the user to share.
how to build a page that can let users share 2 different items on a single page?
You just need two separate Facebook Like Boxes or Buttons (note that Like Boxes can only reference Facebook Pages), each configured to the relevant URL (either the video or the page). You'll only need the script and fb-root tab once on the page.
Like Button documentation
Like Box documentation

Categories