I am having an issue logging a “LIKE” for an application page. It seems that the like is not being inserted into the page_fan table. My concern is that I may be trying to LIKE the application page and not the actual page that contains the application as a tab. I have already written the LIKE code and the like does post to my wall etc. but when I perform the me() query against the page_fan table it does note return my uid.
I have tried the LIKE both within my custom page was well as the global LIKE above all canvas pages on FB page.
My question is: Should my code logic LIKE the ApplicationId(Canvas/iframe) or the PageId in which the Tab exists? Or I am totally off base with my logic.
Here is what I have developed and what I have found.
I have created applications that are accessible on the left hand side of a facebook page (tabs). These are canvas or iframe applications that generate a unique AppId when a new application is created.
For example, I am currently adding the AppId of a canvas page as an OG tag in same canvas iframe page.
I then access the following URL and select the page from an existing list that this tab should appear:
http://www.facebook.com/dialog/pagetab?app_id=111111111111111&display=popup&next=http://facebook.myapp.com/canvaspage.html
I wrote the following code to determine the page_id (for example this returned:222222222222222)
//App PageId
var url = 'https://graph.facebook.com/fql?q=SELECT url, id, type, site FROM object_url WHERE url="'+appURL+'"';
$.getJSON(url, function(data) {
$.each(data['data'], function(index, appPageId) {
if (appPageId) {
var appPageId = appPageId['id'];
}
});
});
<!-- Open Graph for the "PAGE" PagId that has a relationship to AppId (id:) below / I have found that this will include a likes variable if GT 0 -->
graph.facebook.com/222222222222222
{
"id": "222222222222222",
"name": "TEST APPLICATION",
"picture": "http://profile.ak.fbcdn.net/hprofile-ak-ash2/373257_225429330866626_1701496970_s.jpg",
"link": "http://apps.facebook.com/test-app/",
"app_id": 111111111111111, // Below ID - also the AppId
"category": "Website",
"description": "Test App Description",
"can_post": true
}
<!-- Open Graph for "APPLICATION" AppId --->
graph.facebook.com/111111111111111
{
"id": "111111111111111",
"name": "TEST APPLICATION",
"category": "Lifestyle",
"subcategory": "Food & Drink",
"link": "http://www.facebook.com/apps/application.php?id=111111111111111",
"canvas_name": "test-app",
"namespace": "test-app",
"icon_url": "http://static.ak.fbcdn.net/rsrc.php/v1/yT/r/4QVMqOjUhcd.gif",
"logo_url": "http://static.ak.fbcdn.net/rsrc.php/v1/yq/r/IobSBNz4FuT.gif",
"weekly_active_users": "2",
"monthly_active_users": "2"
}
Thanks in advance for your assistance.
You will want to like the Facebook page, not the app ID. Remember a facebook page can have many App Id’s in it (what facebook calls Page tabs).