Reputation: 31
I have followed these tutorials:
http://onlytipsandtricks.com/facebook/facebook-application-development-with-open-graph/
and then:
http://onlytipsandtricks.com/facebook/how-to-publish-actions-on-timeline/
but when i try to post the action i always get:
Message: (#3502) Object at URL xxxxxx has og:type of 'website' The property 'article' requires a object of og:type 'mynamespacexxxx:article'.
My Source Code:
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xmlns:fb="https://www.facebook.com/2008/fbml">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# xxxxxxxxx: http://ogp.me/ns/fb/xxxxxxxxxx#">
<meta property="fb:app_id" content="xxxxxxxxxxxxxx" />
<meta property="og:type" content="xxxxxxxxxxx:article" />
<meta property="og:url" content="http://xxxxxxxxxxxxx/timeline/redir.php" />
<meta property="og:title" content="Sample Article" />
<meta property="og:description" content="Some Arbitrary String" />
<meta property="og:image" content="http://ogp.me/logo.png" />
<script type="text/javascript">
function read()
{
FB.api('/me/xxxxxxxxxxx:read' +
'?article=http://xxxxxxxxxxxxx/timeline/redir.php&access_token=','post',
function(response) {
var msg = 'Error occured';
if (!response || response.error) {
if (response.error) {
msg += "\n\nType: "+response.error.type+"\n\nMessage: "+response.error.message;
}
alert(msg);
}
else {
alert('Post was successful! Action ID: ' + response.id);
}
});
}
</script>
<style type="text/css">
<!--
.style1 {
font-family: Georgia, "Times New Roman", Times, serif;
color: #0066CC;
font-size: 24px;
}
-->
</style>
</head>
<body>
<span class="style1">This is Open Graph test page Click on <strong>Post To your Timeline</strong> button to test.</span>
<fb:add-to-timeline></fb:add-to-timeline>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId:'xxxxxxxxxxxxx', cookie:true,
status:true, xfbml:true, oauth:true
});
</script>
<form>
<input type="button" value="Post To Your Timline " onClick="read()" />
</form>
</body>
</html>
Upvotes: 0
Views: 883
Reputation: 91
I encountered this problem when my application was attempting to publish an opengraph object on my timeline.
In my case, the cause was a server side redirect into the facebook canvas page for the object that I was trying to publish. Because the object page was rendered within an iFrame on facebook, it's og:type wasn't visible, and it was the facebook page's og:type that was being returned.
I solved the problem by creating a minimal page template for my object that contained nothing but the opengraph content and a javascript redirect to the actual object page.
Upvotes: 1
Reputation: 1011
Try the debugger to both see exactly what Facebook sees, and to update Facebook's cache.
Upvotes: 1