Could someone please give me an example of posting a like for a facebook post from an external app with an authenticated user?
Say I have a feed pulling posts from facebook, and I want to create a button that lets the user like a post from my app. On click of this button, how could I best create that like so that the post is updated on Facebook with the user's like?
My thoughts are that I could make a javascript onclick function that ajaxes to a php script that does something like - $facebook->api("/$id/likes",'POST'); , but do I need to re-initialize facebook from that page before I can make this call? or send my access token etc.? This is what kind of confuses me about this server-side method. How do you make this call upon click? An example would be really helpful! Thanks in advance!!