3

I have a Facebook App with an approved action 'Respond To' and an object 'Question'. When I click on the button I created for my action the action data shows in my Timeline, but the metadata for the object doesn't show and nothing shows in my News Feed. What could be causing this?

Action Code:

function postResponse(num,questionnum) {
        var responsestr = document.forms['frm'+num].responsestr.value;
        FB.api('/me/smartassbuddha:respond_to' + question=http://www6.3tierlogic.com/campaigns/smartassbuddha/chapter.php?cp=1&qn='+questionnum+'&re='+encodeURI(responsestr),'post',
                    function(response) {
            if (!response || response.error) {
                alert('Error occured');
            } else {
                alert('Post was successful! Action ID: ' + response.id);
                }
        });
    }

Object Metadata:

<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# smartassbuddha: http://ogp.me/ns/fb/smartassbuddha#">
  <meta property="fb:app_id"               content="213040448788033" /> 
  <meta property="og:locale"               content="en_US" />
  <meta property="og:type"                 content="smartassbuddha:question" /> 
  <meta property="og:url"                  content="http://www6.3tierlogic.com/campaigns/smartassbuddha/chapter.php?cp=<?=$chapter?>&qn=<?=$quenum?>&re=<?=$responsestr?>" /> 
  <meta property="og:title"                content="Chapter 1 - Inspiration" /> 
  <meta property="og:description"          content="<?=$questions[$quenum]?>" /> 
  <meta property="og:image"                content="http://www2.3tierlogic.com/smartassbuddha/images/logo.jpg" /> 
  <meta property="smartassbuddha:response" content="<?=$responsestr?>" /> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Paul L
  • 203
  • 1
  • 2
  • 9

1 Answers1

0

You are missing a question mark (and a tick mark apparently). There's also a problem with your URL-encoding.

It should look something like this:

var responsestr = document.forms['frm'+num].responsestr.value;
var url='http://www6.3tierlogic.com/campaigns/smartassbuddha/chapter.php?cp=1&qn=' + questionnum + '&re=' + responsestr;

FB.api('/me/smartassbuddha:respond_to?question=' + encodeURIComponent(url),'post', function(response) {
  if (!response || response.error) {
      alert('Error occured');
  } else {
      alert('Post was successful! Action ID: ' + response.id);
  }
});
  • Thanks for your help. I updated my code and now the "chapter" and "question" strings show in the aggregation on my Timeline, but not the "response" string (responsestr variable). Still not sure why. I'm also still not sure why nothing is showing in the News Feed either. Any ideas? – Paul L Mar 14 '12 at 18:52
  • Are you sure the responsestr variable is defined as a property for your action in the app's opengraph dashboard? If not, that could be it. Otherwise, this sounds kinda like the problem we're having: http://facebook.stackoverflow.com/questions/13300124/how-do-i-prevent-my-opengraph-action-stories-from-being-aggregated-in-the-news-f – Chris Westin Nov 15 '12 at 19:30