I’ve been attempting to implement the new Facebook open graph features with my flash app. My swf is calling the JavaScript function I have on my page (tested with the simple alert()), however I don’t see the post going through on my timeline nor am I getting the response alert(). I’ve also tested my website with the Facebook object debugger and it tells me that the og:url, og:type, and og: title properties are required, but not present(even though they are in my code).
<meta name="fb:app_id" content="<%=appId%>" />
<meta property="og:type" content="MYNAMESPACE:Game Achievement" />
<meta property="og:title" content="GaveAchievementTitleHere" />
<meta property="og:image" content="https://www.example.com/image.jpg" />
<meta property="og:description" content="description" />
<meta property="og:url" content="https://www.example.com/index.aspx"/>
<meta property="game:points" content="42" />
<meta property="game:secret" content="1" />
</head>
<body>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"></script>
<script type="text/javascript">
function postAction(namespace,actionName,objectName,url)
{
//alert("postAction("+namespace+","+actionName+"."+objectName+","+url+")");
FB.api('/me/'+namespace+':'+actionName+
'?'+objectName+'='+url+'&access_token='+<%=Access_Token%>,'post',
function(response)
{
if (!response || response.error)
{
alert('Error occured');
}
else
{
alert('Post was successful! Action ID: ' + response.id);
}
});
};
</script>
Check that you have “App Domain” defined in your Application basic settings, and that your OpenGraph object url is within this domain.
(I had this kind of issue and setting the AppDomain fixed it. By the way, for an achievement Facebook uses “game.achievement” as object type)