Block coockies from Facebook and Twitter SDK - facebook

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.

Related

Facebook graph-api and js-sdk issue with internet explorer 9-11

I'm having some issue in making social feeds work under ie9.
in this page http://www.axo.com/us/news/ there are the standard Facebook and twitter feeds widget and in ie9 are both not working.
At this other page: http://www.axo.com/us/fbfeed I'm developing a custom Facebook feed following this tutorial http://tutorialzine.com/2011/03/custom-facebook-wall-jquery-graph and I get a white page under ie9
this jQuery plugin use the direct call to 'https://graph.facebook.com/pageId/posts/?access_token=XXXXXXX&callback=?&date_format=U&limit=15
I've read some post that sudgest to use the javascript SDK instead of calling graph.facebook.com. I've made a try
jQuery.getScript('//connect.facebook.net/en_UK/all.js', function(){
FB.init({
appId: 'xxxxxx',
});
var pageAccessToken = 'xxxxxx';
FB.api('/axoracing/feed', {
access_token : pageAccessToken
}, function(response) {
alert("FB.api response")
});
});
but under ie9 the alert doesn't show... so I imagine the call to /axoracing/feed is not getting an answer.
even more strange: if I try to console.log() something it doesn't work in any browser (firefox, safari, chrome, ie, ...). It is really odd and it will be a mess to use the responded object if I can't log it!
I'll really appreciate any help.
Thanks
Daniele
IMPORTANT UPDATE:
For debug purpose I made a test page that call the graph api, the sdk api and the Instagram api. Instagram and graph.facebook calls work in the same way so I inserted the instagram call to check if the issue is in the capability of IE to understand the responded json (I've read this in some answare here in stackoverflow) or if it is an issue only related to facebook.
http://www.axo.com/prova.html
If I look at this page with chorme, firefox, safari and even ie7 it works fine. If I load the page with ie9 or ie11 I get only the instagram feed... no response at all from facebook!
I haven't tested ie8 or ie10 yet.
Do you have any idea? I can't believe it is a facebook incompatibility with ie... I'm sure I'm making something in the wrong way, but what?
Thank for the help
Daniele

Facebook javascript send api error link invalid

I'm developing a referral application where users can refer their Facebook friends using a referral code. I'm using Facebook Javascript SDK. The problem I'm facing is that the send method works only for particular URLs, I mean if I change the users referral token in link parameter it gives me error 100 invalid link.
Here is the method :
FB.init({appId: app_id, xfbml: true, cookie: true});
FB.ui({
to : '********',
method: 'send',
name: 'Message',
link: 'example.com/emp?token=fAiS1ywL0lS8cUYtgLjk',
redirect_uri:'http://example.com'
});
For some particular link values it works fine but if the token is changed it fails with invalid link error.
I'm stuck with fixing this issue. Am I missing something?
Duplicate of Facebook FB.ui send dialog intermittently returns invalid link error.
For your second question related to the og:url meta, to simplify you have to provide the URL of the current page.
The Open Graph Protocol says:
og:url - The canonical URL of your object that will be used as its
permanent ID in the graph, e.g.,
"http://www.imdb.com/title/tt0117500/".
To understand how those metas work you can check how News websites implement this with the Facebook Object Debugger.
For example this link shows you the implemention of metas for a well-known newspaper website.

Make link in Send Dialog to Facebook application?

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.

Can internationalization through the facebook Translations app be achieved inside an iFrame app, without using deprecated FBML technology?

We've invested some time into using the Translations app for our old-style FBML facebook apps. The creation of FBML apps is now deprecated, and only iFrame apps can be created. We would like to have translations in them too, and are considering how to use the Translations app to achieve this.
The internationalization page indicates translations are renderable through (deprecated) FBML tags like fb:intl. It also mentions that XFBML tags (the "newer" tag-set parsed by JavaScript) can play a part, however the documentation for the JavaScript FB.XFBML.parse(..) XFBML method doesn't list any XFBML internationalization tags available to be used with it!
In short, I would like to know if we can use the Facebook Translation app for translations inside an iFrame app, without using any deprecated technology?
[The state of facebook, May 2011]
Since we were trying to use these features and they're still not working I just went ahead and wrote a wrapper that will help parse these tags (using intl.getTranslations and intl.uploadNativeStrings in the background).
It's a bit rough but seems to do the job. Would love to see some forks:
https://github.com/yeldarby/translation.js
If you are using JavaScript SDK just like this:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
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>
Then on this line, change the en_US into your language's code:
<script src="http://connect.facebook.net/en_US/all.js"></script>
You may also use FQL (Not to be deprecated by facebook)
http://developers.facebook.com/docs/reference/fql/translation/
The docs indicate that you can do it, but you can't.
The only way you can use the translation app is by calling intl.getTranslations, intl.uploadNativeStrings, or querying the FQL translation table

Facebook comments on web-site and on on facebook page

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>