I have a web-site, where I have facebook comments social plugin on each page and I have facebook page, where I publish items as "shared links" from my site via RSS (through dlvt.it). Links to items are the same.
Now comments are diferent in two places (on facebook page and on web-site)
The question is how can I make that comments on facebook page items appears also on my web-site's comment form ?
Regards,
Anton.
You need to create a Facebook application. Once you have created this, you'll get your app_id. In your website, you can then add:
xmlns="http://www.facebook.com/2008/fbml"> to your HTML tag, and then add in the body tag:
<script src="http://connect.facebook.net/en_US/all.js#appId=YOURAPPID&xfbml=1"></script>
<script type="text/javascript">
FB.init({
appId: 'YOUR APP ID',
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
</script>
This will allow you to access Facebook plugins from your website. So, for comments you can use:
<fb:comments href="Your Page" num_posts="10"></fb:comments>
Related
I have a very basic HTML page and I just added the option to share it via Twitter or Facebook. However when I added:
https://platform.twitter.com/widgets.js
https://connect.facebook.net/en_US/all.js
I realized that a few cookies (7 for Facebook & 19 for Twitter) appeared on my page. As looking through the code I saw that the FB.init function has an option to disable cookies:
FB.init({
appId: "122980495023997",
channelUrl :'http://playthepiano.com',
status: true,
xfbml: true,
cookie: false
});
or at least that is what I thought. However, even when I switched it to false I still have cookies from Facebook on my page. For Twitter my searched showed nothing. Is there a way I can completely block all cookies from Facebook and Twitter?
PS: I am very new to developing so please excuse me if my questions makes no sense. Thank you in advance.
In my website I want to integrate the "Invite your friends to like this Page" similar to the Facebook Fan Page(Any), where people can search a friend and send an invite to like a page, after receiving and clicked that notification the user will be redirected to the Facebook Fan Page.
This what I do, by adding an App and Creating a Facebook Canvas in the Developer Tools and with this piece of code in my website:
window.fbAsyncInit = function() {
FB.init({
appId : '577325869064730',
cookie : true,
xfbml : true,
version : 'v2.2'
});
};
function sendInvite() {
FB.ui(
{
method: 'apprequests',
message: "I am inviting you to like my page"
},
function(response) {
console.log(response);
}
);
}
It seems do the work, but the problem is it is not really the one I'm expecting because, It's not redirecting to the my Facebook Fan Page and the Facebook canvas URL only allowed a secure URL ("https") and doesn't allow the URL Facebook.
Is there a workaround for the redirection of the URL, rather than redirect to the declared URL in the Facebook canvas it should be pointed to my Facebook Fan Page. And the result should be the FULL Page of the Facebook Fan Page not in the Canvas.
Can this be done?
apprequests are for inviting friends to a game app on Facebook Canvas, not for inviting them to a Page (APP requests, hence the name). It will always redirect to the Canvas Page.
Better use the Send Dialog or Share Dialog. Of course you donĀ“t need https for those.
So far I was able to find a way to redirect it on the Facebook Fan Page, I just don't know if this is the correct solution:
In the website header, the one I declared in the Facebook Canvas URL:
I inserted this code:
<script type='text/javascript'>
top.location = "www.facebook.com/fanpage"
</script>
It is now redirecting to the Facebook Fan Page.
Hi so I am making a Facebook app which uses the send dialog. I was wondering why it doesn't work when I put 'https://apps.facebook.com/APP_NAME/' as my link parameter. I want the link in the send message to be a link to my app but on the send dialog is appears as apps.facebook.com. Is there anyway to do this?
Edit: Yes sorry here is the code:
<script>
FB.init({appId: 'App_ID', xfbml: true, cookie: true});
function sendMessage(){
// assume we are already logged in
var token = FB.getAuthResponse().accessToken;
FB.ui({
method: 'send',
name: 'Test',
link: 'https://www.apps.facebook.com/APP_NAME',
description: 'This is a test',
picture: '',
display: 'iframe',
access_token: token
});
}
</script>
If you dont want the apps.facebook.com domain showing up in the caption for the post, you ca theren create a new page in your site. Set all the og meta tags to what you want to show up in the feed. The only other content in the page should just be a javascript redirect to your you canvas app. This way when FB scrapes your site, they get all the necessary data and when a user clicks on the link, the js redirects them to your app.
Also, there is not a "www" in the url for app canvas pages.
I have an invite dialog on my page:
<a href="#" onclick="sendRequestToManyRecipients(); return false;" >xx</a>
<script language="javascript" type="text/javascript">
FB.init({appId : 'myappid', status : true, cookie : true, oauth: true});
function sendRequestToManyRecipients() {
FB.ui({ method: 'apprequests', message: 'xxx'},requestCallback);
}
function requestCallback(response) {
// Handle callback here
}
</script>
When the invited user clicks the invite, he gets linked to the app, but I want the user to get redirected to a page like http://www.facebook.com/pages/xxx/xxx?sk=app_xxxx.
How can I do that?
That's not possible without some custom coding - the requests interface exists to drive traffic to apps on facebook, not to page tabs, there's no way to have Facebook send users to a tab when they accept the request.
You could just implement something on your canvas landing page that redirects users back to a page tab based on the information in the request as a workaround.
previous version of the apprequest which is request-form this was possible: How can I include a link in a FB app request?
However current version of apprequest : facebook guys lets only redirect to your app: https://apps.facebook.com/yourapp
#Vihay comments helps this custom workaround to redirect to page.
Hoping next version apprequests, facebook enables redirect to links within the fb app.
Agree with previous answers. Facebook will redirect to your app, which is just a Facebook wrapper around a page you can provide. That page can then use a client-side redirect to whatever page you'd like (like what Klout does).
Problem on facebook like button html :
Facebook is showing here
That you can add a like button to your site that allows users to also add a comment right
after clicking on the "LIKE" button.
From some reason, when I try that html on my site, it doesn't work.
My site is public and I also got the required META tags inside my html.
Help, anyone ?
Commenting currently only works with the XFBML version:
<fb:like></fb:like>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({ appId: 'YOUR APP ID', xfbml: true });
</script>
Or starting Wednesday (new feature not yet released) the simpler version:
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like></fb:like>
NOTE: You only need one set of the script tags, and you can add as many <fb:like> or other XFBML widgets after that.