Linking to a page tab app on a Facebook page - facebook

Is there a reliable way to link to an app on a Facebook page, when only the page ID and app ID are known? Specifically the URL to the page is not known, only the ID.
The documentation at https://developers.facebook.com/docs/authentication/pagetab/ claims that the following should work:
https://www.facebook.com/pages/null/PAGE_ID/app_YOUR_APP_ID
However when I try this, for example http://www.facebook.com/pages/null/126169047465269/app_222972467721305 does not work and instead I get "This content is currently unavailable".

The best form that will always work for a numeric page ID is this:
https://www.facebook.com/pages/null/PAGEID?sk=app_APPID
Replace PAGEID and APPID with numeric IDs.
If instead of a numeric page ID you have a username, then the URL should be of this form:
https://www.facebook.com/PAGEUSERNAME?sk=app_APPID
or
https://www.facebook.com/PAGEUSERNAME/app_APPID

The Page here is not Public or maybe is not available?:
https://www.facebook.com/pages/126169047465269/
Try this,
https://www.facebook.com/PAGE_NAME_OR_ID/app_222972467721305
In the PAGE_NAME_OR_ID add pages/126169047465269,
if your page have a custom slug add the slug.
But to be sure check if your app is in a Sandbox mode or Unpublished.

Related

Single Facebook App multiple Client Facebook Page Tab

I have created a Facebook Application which will be used as a Facebook Tab Page. My problem is that I am unable to get the page id.
I want to use this single application for multiple Facebook Page Tabs but the content will vary based on the Page Id.
The code I am trying to use to get the signed_request is using the JavaScript SDK.
FB.getLoginStatus(function(response) {
console.log(response);
})
This can be done with the signed_request parameter, which is passed on to your URL.
The easiest solution is to use the PHP SDK. It offers a function called "getSignedRequest": https://developers.facebook.com/docs/reference/php/facebook-getSignedRequest
Those are the fields of the signed_request parameter: https://developers.facebook.com/docs/reference/login/signed-request
If you donĀ“t want to use the PHP, you need to parse the parameter on your own. Check out this link for more information and search for "Parsing the Signed Request": https://developers.facebook.com/docs/facebook-login/using-login-with-games
Edit: you will not get the correct signed_request using the JavaScript SDK. Use PHP (or your server language) for this.
The mistake was that the URL added in the Facebook page tab settings was getting redirected as it did not have a "/"; there was a redirect for SEO added and the URL in the Facebook APP sittings did not have the "/".
So as it was getting redirected Facebook sent the POST variable but we have not handled it. Now it is fixed.
Special thanks to #luschn and #Fran Barbero for all your efforts in this.

How do I generate Facebook like button with only the FB page ID

So I have a database table with the Facebook page ID's of my users. I would like to generate a like button dynamically with only the ID available to me to do this. The problem as I see it is that I don't know what the data-href attribute is supposed to have considering that Facebook page url's look like this: http://facebook.com/pages/hyphenated-name/<?=$FB_id?> and I don't have the hyphenated name stored in my database to generate the that url.
Is there another URL structure Facebook's back-end will accept that just has the ID and not the hyphenated name, but will still count likes on that person's Facebook fan page? Is this impossible?
You can do a look up of the id, and retrieve the link of the page stored.
example: https://developers.facebook.com/tools/explorer?method=GET&path=191825050853209
refer to: https://developers.facebook.com/docs/reference/api/page/ under link connection.
This method will require use of the graph api, or one of the sdks.
refer to: https://developers.facebook.com/docs/reference/api

Does the url I provide for Facebook Like Button need to be exact or can it be one that redirects?

So I'm trying to generate the right URL to go in the facebook Like button. The URL is to a person's facebook page and it's generated using their facebook page's ID.
The facebook like button developers page says that I need to include this URL in the data-href="" attribute in the <div> they provide (that the iframe is generated in).
When I go to a URL like http://www.facebook.com/234h23o4ub23 it redirects to the right place. So I'm wondering if I can get away with using this shorter url as opposed to the url that it redirects to like for example: http://www.facebook.com/pages/example-venue-name/234h23o4ub23. I don't have the "example-venue-name" segment of the URL stored in my database making this method very difficult. Is that page going to register that it was liked or do I have to do the entire URL?
The URL on the like button is actually just what the user will follow back, so as long as the user can follow the link, you will be fine. The link is the unique tracker to the object so that Facebook knows distinct objects.

Facebook comment/like url

Am having difficulty with the url for the facebook comment and like plugins. if I put in a simple url like "www.example.com" it works fine but my app is on a subdomain and uses querystrings to differentiate between different page states. So a sample url would be something like "facebook/example.com/index.php?id=001". However it appears facebook doesn't like this and keeps saying it is unreachable.
I can't believe facebook would limit the scope like this. Someone else must have encountered this. Any suggestions?
Facebook posts have an id something like 123456789012345_123456789012345.
The part prior to the underscore is the page id. The part after is the post id. The URL would be https://www.facebook.com/pageid/posts/postid, or https://www.facebook.com/123456789012345/posts/123456789012345.
Check your URL in Facebook's Debug Tool and this will show the tags Facebook is detecting on your page -in particular check your og:url tag isn't ommitting the URL parameters

Hyperlinking to Facebook iframe application without knowing page name

I have a Facebook iframe app that runs on various Facebook pages. I can create a link directly to my app with the following hyperlink:
http://www.facebook.com/pages/PAGE-NAME/PAGE-ID?sk=app_APP-ID
where PAGE-NAME, PAGE-ID, and APP-ID are populated with their corresponding variables.
Is there a way to link to my app if I don't know the PAGE-NAME, and only know PAGE-ID and my APP-ID?
I can link to the page without knowing the PAGE-NAME using the following hyperlink:
www.facebook.com/profile.php?id=PAGE-ID
However I can't seem to find a way to link to my app's iframe on the page. I've tried these 2 links but they don't work either:
www.facebook.com/profile.php?id=PAGE-ID&sk=app_APP-ID
www.facebook.com/profile.php?id=PAGE-ID&v=app_APP-ID
http://graph.facebook.com/PAGE_ID
json_decode that, get the LINK field.
append your
?sk=app_APP-ID