Question

I know how to check if Facebook like button is clicked by edge.create , but the website addmefast.com , opens the Facebook page in new window, and when you close the window, the parent window gets something return that whether i clicked like or not.

i can check this in the same window, but how do they do it on a new window, which is on separate domain i.e Facebook. They are not using any signed application or user permissions to check his likes etc..

UPDATE:

I read the java-script of the website, and what it does is checks the number of like before, and after opening the window, and then if the likes have increased they award you points, no matter whoever like the page in that time, i tested it, i opened the window for like, and did not like, and asked my friend to like it from his computer, and i was awarded points, so they cannot really check whether i liked it or no. Obviously they need to use signed Facebook app to do this.

Was it helpful?

Solution

Yes, I can confirm, that's exactly the method they use.

When you click on the like button from their page, they open a child window and ask their server to make a direct call to graph.facebook.com/pageID. After that, they save a before record with the number of page likes.

When you close the child window (this means you just liked the page), they make another call to the facebook graph, retrieve the before record and check if the number of likes have increased.

var win = window.open(url, name);
win.onunload = afterChildClose; // afterChildClose() is the function.
win.close(); // afterChildClose() should fire now.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top