Facebook App QueryString - facebook

Up until recently our FB app was passing QueryString parameters that we used to identify app users and provide them with their data through the app. Now it just has the RAW URL without the parameters.
Did Facebook change something regarding apps? Is there something I have to do in our app?

Hi are you talking about the page link? you can get this by using FQL
eq https://api.facebook.com/method/fql.query?query=SELECT+page_id,+page_url,+fan_count,+website,+name,+username,+founded,+company_overview,+mission,+pic+FROM+page+WHERE+page_id= facebookPageId &access_token= accessToken
paste this into your browser to see a live example https://api.facebook.com/method/fql.query?query=SELECT+name%2C+fan_count+FROM+page+WHERE+page_id+%3D+19292868552

Related

Facebook Page Tab app [duplicate]

I created a Facebook App (Page Tab). This App can be added to Fanpages.
In this App, I make a call with Javascript to get the right JSON Data for my App.
The data is specific to the FB-Site where my App was been added.
I.e. when Coca-Cola adds my App to their Fan Page, I need to know that is coca cola - to get the right data.
Now, my Idea is when creating the Page Tab, save the ID from the Page. And when making a call to get the data in the page tab sending the Fanpage ID as a parameter.
I hope it is reasonably clear what I mean.
My Question is, how got access to ID of the Page?
Best with Javascript. Or is this not possible?
I would appreciate any tip!
This would be very easy with the PHP SDK. A signed_request parameter will get passed on to your iframe, and the PHP SDK offers a function called getSignedRequest() to parse it:
https://developers.facebook.com/docs/reference/php/facebook-getSignedRequest/
For example:
$sr = $fb->getSignedRequest();
echo $sr['page']['id'];
With JavaScript it would be a lot more complicated. You could try to get the signed_request parameter like this: How to retrieve GET parameters from javascript? - But you would have to deal with the parameter on your own. Here´s how to parse the parameter on your own with PHP: https://developers.facebook.com/docs/facebook-login/using-login-with-games
No Facebook SDK needed in that case, btw. And it should also work with PHP <5.4.

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.

Need help identifying facebook app which is referring visitors to our homepage

We're getting lots of visits today from what I think is an unidentified facebook app. Page urls include:
/?fb_source=canvasbookmark&count=0
/?fb_source=search&ref=ts
/?fb_source=canvasbookmark_more&count=0
/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=3_0
/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=6_0
/?fb_source=bookmark_seeall&ref=bookmarks
/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=16_0
/?fb_source=appcenter_request
/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=2_0
/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=8_0
/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=14_0
/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=17_0
/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=5_0
/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=7_0
/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=9_0
/?fb_source=bookmark_favorites&ref=bookmarks&count=0&fb_bmpos=9_0
We didn't create this app. Is there any way to identify it?
If it has the 'bookmarks' reference, it means the app is configured as a mobile or canvas app.
If it's a canvas app, these are likely POST requests to your server, not GET requests.
The POST request will contain a signed_request parameter with some variables for your app
You can see information on what's in that signed_request using the Echo tool on Facebook's developer site: https://developers.facebook.com/tools/echo?signed_request=SIGNED_REQUEST_HERE - i'm not sure if it'll show you the app ID, but it may provide enough other relevant information to see what app people are trying to load

How to get the header URL of a Facebook fan page?

I'm developing a Facebook app and I need to get the URL of the page where the app is installed to set their share buttons and other params.
Thanks!
Take the page id from the signed request (http://developers.facebook.com/docs/authentication/signed_request/) and then call /PAGEID?fields=link and pull out the link value. This would be the url.

DeepLink in Facebook Fanpage

i'm looking for a solution to proceced deeplinks to a facebook fanpage like:
http://www.facebook.com/myfanpage?sk=app_MYAPPID&parameter=2
I need to get the value of parameter in my Fanpage app.
Use the app_data parameter in your link, and the value of this will be passed to your app in the signed_request which is sent on page load. Many developers use JSON encoded data as the value for app_data as they want to store multiple values
This is documented here: https://developers.facebook.com/docs/appsonfacebook/pagetabs/#integrating
I don't understand clearly but what you want is getting parameters from url in facebook is not possible in pagetabs i tried it many times but it won't work.
The only way getting parameters from url in facebook is creating canvas app. Because canvas apps act like domain so you can use whole parameters and urls.
If i missunderstood sorry for it.