Данные об открытом графике Facebook не отображаются в новостной ленте или на временной шкале - PullRequest
3 голосов
/ 21 февраля 2012

У меня есть приложение Facebook с утвержденным действием «Ответить» и объектом «Вопрос».Когда я нажимаю на кнопку, которую создал для своего действия, данные действия отображаются на моей временной шкале, но метаданные для объекта не отображаются и ничего не отображается в моей ленте новостей.Что может быть причиной этого?

Код действия:

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);
                }
        });
    }

Метаданные объекта:

<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" />

1 Ответ

0 голосов
/ 21 февраля 2012

Вам не хватает знака вопроса (и, видимо, галочка).Также есть проблема с вашей URL-кодировкой.

Это должно выглядеть примерно так:

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);
  }
});
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...