facebook-api: what's Facebook Connect cross-domain receiver URL? - facebook

I'm trying to configure that my facebook application will be resizeable.
The docs at http://wiki.developers.facebook.com/index.php/Resizable_IFrame
talk about facebook connect cross-domain receiver URL.
and in the JS code i need to enter the 'site relative url to xd_receiver.htm'.
what's that?
what code should be in that HTML file ?
thanks

This is a file saved to your local web server. It allows Facebook to save a cookie that you have access to. Basically, it allows Facebook Connect to work.
Easiest thing to do is just place it in your web root (http://example.com/xd_receiver.htm)
This file should contain the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Cross-Domain Receiver Page</title>
</head>
<body>
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js?v2" type="text/javascript"></script>
</body>
</html>

Related

anchor tag with href as other than http is not working while sending mail to gmail

I am using the smtp sendmail function, in the anchor <a> tag href attribute we have reference other than http:// ie something like below
transauth://some other data
but the gmail is not creating the hyperlink of transauth but creating of http://gmail.com ,Any solutions regarding this.
Gmail strips links that use custom uri schemas.
A work around however is that if you have a website somewhere you can host a simple redirect page that will redirect you to the correct schema.
This is a pretty bullet proof redirect here I copied from this answer to another question
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=http://example.com">
<script type="text/javascript">
window.location.href = "http://example.com"
</script>
<title>Page Redirection</title>
</head>
<body>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow the <a href='http://example.com'>link to example</a>
</body>
</html>

How to Redirecting to source url from form (where submit or close the form)

On our main intranet page (homepage) http://indi.cdc.com I created a link to InfoPath form that is on a site collection http://indi.cdc.com/salesteam. So the link looks like this. When user click Submit or Cancel they are not redirected back to homepage (http://indi.cdc.com). They are seeing "The form has been closed.). Please suggest.
I tried following and neither is doing the redirection.
http://indi.cdc.com/salesteam/Lists/RequestsList/Issue/newifs.aspx?Source=http://indi.cdc.com/Pages/Home.aspx
http://indi.cdc.com/salesteam/Lists/RequestsList/Issue/newifs.aspx?Source=http://indi.cdc.com/Pages/Home.aspx?target=http://indi.cdc.com/salesteam
Created a redirect page (http://indi.cdc.com/salesteam/SharedDocuments/Redirecting.html)
Created a view on the target list where the InfoPath form is redirect.aspx, edit the page and dropped a CEWP and reference above html file from it. (http://indi.cdc.com/salesteam/spteam/Lists/RequestsList/redirect.aspx)
Recreated the link on the homepage.
http://indi.cdc.com/salesteam/spteam/Lists/RequestsList/Issue/newifs.aspx?Source=http://indi.cdc.com/salesteam/Lists/RequestsList/redirecting.aspx
Here is the html code for redirecting.html page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Refresh"
content="0; URL=http://indi.cdc.com">
<title></title>
</head>
<body>
</body>
</html>

Embedded Youtube video won't play in Facebook app

I'm working on a simple FB app of a type I've done many times before. It works perfectly outside FB but once it's in FB, the youtube embed simply doesn't load.
I pulled the code out into a test file, and it still won't load. Here's the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
</head>
<body>
<iframe width="669" height="391" src="http://www.youtube.com/embed/48P1jc5tyTw" frameborder="0" allowfullscreen></iframe>
</body>
Absolutely nothing displays when this is loaded as an app on a FB page. The FB debugger says "Can't Download Could not retrieve data from URL."
Any ideas?
Try changing the src of the iframe to "https://...".
Since Facebook is served over HTTPS, your browser will block any content from loading on the page that's not over HTTPS too. Fortunately, youtube supports https versions of their URLs.

Can't solve Facebook Open Graph Meta tags not being scraped for my Wordpress site

This is my first time posting a question on this site, but certainly not the first time finding answers in it.
I have used stackoverflow as a resource to fix several issues I've faced with my new blog, that is until last night, when I found this issue which I just can't fix.
When I try to share the home page of my blog, I don't get the proper image specified in the og:image tag... once I check my site via de FB debugger, it shows me this:
https://developers.facebook.com/tools/debug/og/object?q=ivanfuentes.com
Curiously enough, I do not find any issues when I check for a page, or a post:
https://developers.facebook.com/tools/debug/og/object?q=ivanfuentes.com%2Fvideos%2F
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fivanfuentes.com%2Fthe-popularity-contest%2F
So, I know it's an issue that is generated in the home page only, but during the last 18 hours, have been unable to find it.
I have OG meta tags specified dinamically via a wordpress plugin... currently, it's "Facebook AWD", but I've had several other Facebook sharing, all-in-one's, and OG plugins, which give me the same results in the debugger, which makes me think I messed up somewhere else. I have no embarrassment in admitting I'm quite a newbie, so it's highly likely I messed up while trying to modify some code... probably when I added a few lines to make the site IE compliant?
Hope I gave enough information, and someone gets to help me, as this is not only about the proper image being displayed on a Facebook link, but rather about me likely having a mess in my code, and that could (WILL) mean trouble once I make any mods/updates to my site in the future.
Thanks for the time!
Your html is a complete mess and that's why the debugger is complaining.
Visiting your page and looking at the code I can see this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<div id="fb-root"></div>
<script>
...
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<div id="fb-root"></div>
<script>
...
</script>
<title>Ivan Fuentes Hagar</title>
Two problems there:
The sdk code is inserted twice
In both cases there's a div placement before the body
In the debugger result for this page when clicking the bottom link (Scraped URL: See exactly what our scraper sees for your URL) you can also see broken html but in another variation:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><body>
<div id="fb-root"></div>
<script>
...
</script><meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
...
</script><title>Ivan Fuentes Hagar</title>
There problems here:
The body definition is right after the html
There's no head definition
All of the tags which suppose to live inside the head are inside the body
The sdk script is loaded inserted twice
In both cases I found 3 occurrences of the <div id="fb-root"></div>.
As you can see you have some fixin' up to do with the html output of your wordpress.
I'm not sure why the outputs is different for the debugger, I thought that maybe due to the user agent string, but trying curl --user-agent "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" "http://ivanfuentes.com/" returns the exact results as with the browser.

FacebookSDK Cross Domain Receiver Problem

Hi can somebody help me. I can't get rid of this error message in Chrome 9.0 beta, Chrome 8.0 or Firefox 3.6.13:
"Unsafe JavaScript attempt to access frame with URL 'http://apps.facebook.com/myapp/' from frame with URL 'http://myapp.dyndns-office.com/'. Domains, protocols and ports must match."
I'm using the FacebookSDK version 4.1.1 CSMvcFacebookApp in the Samples folder.
I have this script in my Site.Master page located in Views/Shared:
<script language="javascript" type="text/javascript">
$(document).ready(function () {
FB_RequireFeatures(['CanvasUtil'], function () {
FB.XdComm.Server.init("<%= ResolveUrl("~/xd_receiver.htm") %>");
FB.CanvasClient.startTimerToSizeToContent();
});
});
</script>
I have xd_receiver.htm in my root directory, and presumed that the above javascript code was all I needed to do verify my domain with facebook.
Is my presumption correct or has things changed?
I even tried moving the FB code out of the JQuery ready function like so:
<script language="javascript" type="text/javascript">
FB_RequireFeatures(['CanvasUtil'], function () {
FB.XdComm.Server.init("<%= ResolveUrl("~/xd_receiver.htm") %>");
FB.CanvasClient.startTimerToSizeToContent();
});
</script>
But this doesn't work either ...
Can anybody shed some light as to what I'm doing wrong or how I get xd file to work using the SDK/MVC IFrame solution...
FB.CanvasClient.startTimerToSizeToContent() is firing because I don't have the scroll bars appear in my application, so that proves that FB_RequireFeatures function is working. But as to whether FB.XdComm.Server.init is doing it's part I'm just not sure as to how I go about testing this ???
The content of my xd_receiver.html file in my root directory is:
<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>cross domain receiver page</title>
</head>
<body>
<!--
As described in: http://wiki.developers.facebook.com/index.php/Cross-domain_communication_channel
-->
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"></script>
</body>
</html>-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"></script>
</body>
</html>
XdCommReceiver.js exists as I just copied the pasted the url into the browser. Are my paths correct or have facebook up and change the url's etc ... ?
I understand that my main concern here is that Safari won't run my app at all if I don't get this cross domain stuff sorted out now.
Any help here would be much appreciated :-\
Thanks
Rob
<< ADDITIONAL COMMENT >>
Is there a built in mechanism in the latest version of the FacebookSDK v 4.1.1 to make this cross domain stuff just work? Did the developers of the SDK think about this issue? Or have I just brought up a future feature ... :-\
Here's the code you need to have in your cross-domain scripting channel file:
<html><body><script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script></body></html>
Here's the code to initialize the FB Javascript SDK. Put this at the very end of your HTML files, substituting in the appropriate values and URLs.
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script><script type="text/javascript">FB.init({appId: '1234567890', status: true, cookie: true, xfbml: true,channelUrl: 'http://example.com/xss_channel.htm'});</script>
Optionally, put this in your web.config where the XSS channel file is located. This lets browsers cache the file indefinitely as recommended by Facebook.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<location path="xss_channel.htm">
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Expires" value="Tue, 01 Jan 2030 16:00:00 GMT" />
</customHeaders>
</httpProtocol>
</system.webServer>
</location>
</configuration>
And finally, if you're using XFBML, place this namespace definition in your <html> to make XFBML work in IE:
xmlns:fb="http://www.facebook.com/2008/fbml"
You are using the old Facebook Connect Javascript. The Facebook C# SDK is not compatible with the old Javascript SDK. You should use the new Facebook Javascript SDK (as was included in the sample). http://developers.facebook.com/docs/reference/javascript/