Home random response from facebook graph api
Reply: 0

random response from facebook graph api

Leonardo Javier
1#
Leonardo Javier Published in 2017-12-05 15:14:11Z

This is weird. I am developing a site that has differents articles and I want to implement an og.like button. So I'm using javascript graph api.

When user clicks on my personalized like button the script does following to see if user already likes the article:

FB.api( "/", "POST", {
    batch: [
      { method :"GET",  name :"object_id",  relative_url :"/?id=<?php echo $canonical_url; ?>&fields=og_object"},
      { method :"GET",  relative_url :"?id={result=object_id:$.og_object.id}&fields=reactions.limit(0).summary(true)"}
    ]
    },
    function (response) {
      if (response && !response.error) {
          result = JSON.parse(response[1]['body']);
          console.log(result.reactions.summary.viewer_reaction);
      }
      else {
          console.log(response);
      }
    }
);

and the answer is:

SOMETIMES LIKE

SOMETIMES NONE

it seems to be completely random, any suggestion?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.29553 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO