Walker
Walker

Reputation: 134453

Facebook like button doesn't remember "likes" (keeps resetting on refresh)

I have an app that creates dynamic pages for users with like buttons.

The button works on all of the pages, but when I refresh the pages some of them don't "remember" the like count (or that I liked the page a second ago), while others work perfectly.

Here's an example of a page that remembers the like count: www.teespring.com/teespring

And one that doesn't work: www.teespring.com/brownrugby

Upvotes: 0

Views: 1703

Answers (2)

Satyajit Paul
Satyajit Paul

Reputation: 345

The problem lies the value of the meta tag fb:admin. Here is what you have published -

"102628019845885" is not a valid Facebook user id. Please correct it and your users would be able to "Like" your page.

Well, you can debug such issues yourself, just go to Facebook tool - http://developers.facebook.com/tools/debug

I figured it out earlier today after spending few hours while debugging a similar issue for my app http://www.jokeshive.com

Upvotes: 3

Jim Rubenstein
Jim Rubenstein

Reputation: 6920

If you monitor your network traffic while you click the like button, you can an XHR request to Facebook to create the Like for the user.

You will see when you click the like button, Facebook makes this request, and returns a JSON string with the status. Yours actually fails and here's the relevant part of the returned response.

    "payload":{"requires_login":false,
            "error_info":{"brief":"App ID does not match domain",
            "full":"The app ID specified within the \"fb:app_id\" meta tag is
             not allowed on this domain. You must setup the Connect Base Domains 
             for your app to be a prefix of http:\/\/teespring.com\/brownrugby.","errorUri":"\/connect\/connect_to_node_error.php?
             title=App+ID+does+not+match+domain&body=The+app+ID+specified+within+the+\u002522fb\u00253Aapp_id\u002522+meta+tag+is+not+allowed+on+this+domain.+You+must+setup+the+Connect+Base+Domains+for+your+app+to+be+a+prefix+of+http\u00253A\u00252F\u00252Fteespring.com\u00252Fbrownrugby.&hash=AQAacTBYi-g6Czel"},

From this response, it seems like there's an issue with the domain configuration of your application, or the app id configuration of your open graph object pages.

Hopefully this helps and points you in the right direction.

Upvotes: 1

Related Questions