Search code examples
iosfacebookmobilefacebook-like

Built-in Like and Like Button


I'm planning to use the Built-in Like for mobile users, and the standard Like Button for web users to "like" a webpage.

But is the Built-in Like feature has a connection to the Like Button (Social Plugin)?

From my observation:

On web version, after I clicked the standard Like Button, the Open Graph Object can track that like instantly

Calling fql?q=SELECT share_count, like_count, comment_count, total_count, click_count FROM link_stat WHERE url="http://websitelinkhere.com";

returns

{
  "data": [
    {
      "share_count": 0, 
      "like_count": 1, 
      "comment_count": 0, 
      "total_count": 1, 
      "click_count": 0
    }
  ]
}

But using the Built-in Like, the Open Graph Object cannot track that 'like' at all, the like_count and total_count are both 0.

And then here's the funny part:

By checking my og.likes using https://graph.facebook.com/userid/og.likes?access_token=myAccessToken

It returns TWO likes, 1 from the Like Button and 1 from the Built-in Like Action

{
   "data": [
      {
         "id": "10151050736776633",
         "from": {
            //skipped
         },
         "start_time": "2012-08-24T07:10:52+0000",
         "end_time": "2012-08-24T07:10:52+0000",
         "publish_time": "2012-08-24T07:10:52+0000",
         "application": {
            //skipped
         },
         "data": {
            //skipped
         },
         "type": "og.likes",
         "no_feed_story": false,
         "likes": {
            "count": 0,
            "can_like": true,
            "user_likes": false
         },
         "comments": {
            "count": 0,
            "can_comment": true
         }
      },
      {
         "id": "10151050736586633",
         "from": {
            //skipped
         },
         "start_time": "2012-08-24T07:10:42+0000",
         "publish_time": "2012-08-24T07:10:42+0000",
         "application": {
            //skipped
         },
         "data": {
            //skipped
         },
         "type": "og.likes",
         "no_feed_story": false,
         "likes": {
            "count": 0,
            "can_like": true,
            "user_likes": false
         },
         "comments": {
            "count": 0,
            "can_comment": true
         }
      }
   ]
}

And then by using action id returned by og.likes, I can delete both likes using

curl -X DELETE \
     -F 'access_token=accessToken' \
     https://graph.facebook.com/10151050736776633

and

curl -X DELETE \
     -F 'access_token=accessToken' \
     https://graph.facebook.com/10151050736586633

Is it because I haven't submit my application to Facebook for reviewing yet?

I'm expecting the Built-in Like and Like Button work together as ONE action, but not generating og.likes independently.

Thank you for your time.


Solution

  • Adding og:url and using the Open Graph Object ID directly fixes the problem.

    curl -X POST \
         -F 'access_token=accessTokenHere' \
         -F 'object=UsingOpenGraphObjectIDHereDirectly' \
         https://graph.facebook.com/useridhere/og.likes
    

    May be related to Impossibile to publish built-in Like action on Open Graph Pages with Likes