I use an application added to a Facebook page to subscribe to real-time updates which has worked fine and still works fine. However, the old way of adding an application to the page using add.php seems to redirect to the dialog for adding pagetabs now.
Add.php: https://www.facebook.com/add.php?api_key=XXX&pages=1&next=URL
This no longer works and redirects to:
https://www.facebook.com/dialog/pagetab?api_key=XXX&next=URL
This would be fine if we could use the application on the page without displaying an empty pagetab on the wall.
So does anyone know of any changes to this process and a new way to add an application to a page as an application and not a pagetab? Will this require using the Graphi API and manage_pages permission to do it or is there a simple URL method we can follow?
Thanks in advance.
Here is the correct way to add an Application to a page that is not a page tab.
https://developers.facebook.com/docs/graph-api/reference/page/tabs/
Basically the old add.php method has been removed but you can still add applications that do not contain a pagetab to a page by making the following call:
POST: /{page-id}/tabs
app_id = {app-id}
is_permanent = false
you need the page access token to do this.
Further information can be found in the bug report here: https://developers.facebook.com/x/bugs/779220265438820/
Thanks to Pragati on that bug report who pointed me in the right direction.
This is no longer possible to do.
You can get part of the way there with Open Graph objects, but they don't give you any ability to run code on the page and are restricted to particular display typesl
Related
Please accept my apology if my question has a simple answer. I'm trying to add a functionality to login through google account with PHP and OAuth 2.0. I tried this on a simple login page and its working fine.
Now, I have a page of recipe where user can give their comment. Page URL is something like this mysite.com/recipe-123-recipename. I changed URL through .htaccess. Original link is mysite.com/single_recipe.php?id=123&title=recipename.
There is a option of redirect URL in google API console and it is optional so I left it blank. Every time I try to use script i get redirect URL mismatched error.
I just need to know how can I set redirect URL like single_recipe.php?id=123&title=recipename so user get back to this page? or I need to change the script? I have added facebook login in same page and it is working great.
Please guide me I tried everything but no luck so far.
I'm relatively certain after reading the facebook Open Graph documentation that I can't have a web site 'subscripe' to a public page, unless that page installs my app. Let me know if that is wrong.
What I am trying to make is a photo gallery, pretty simple, but it grabs photos from a public 'page' such as a college or university.
I would like it to update itself anytime there is a change. I was hoping I could do it through the API, possibly using API updates/subscription
Facebook App Subscriptions -
but I don't think that will work. I'm using PHP, are there other ways to listen and see if there has been a change? Other than just firing off a function every now and then, using CRON or some other such server tool. I would think that facebook would probably also not like that behavior, though I'm not sure.
As of right now, I am able to grab JSON from a public page's photo gallery using the API and the photo gallery works just fine, I'm mostly just wondering what the optimal of having it update itself automatically is.
You are correct in assuming that real-time updates for pages require admin access to the page to work. You need a page access token to be able to subscribe to updates for a specific page, and such a page access token you can only get from users that have admin privileges for that page. (The page does not need to install your app as a tab any more, they changed the subscription process in that regard; but the page access token is still necessary. Basically you can say, you can not subscribe to updates for just any arbitrary page, it has to be “your” page.)
Apart from that, all you can do is check for new content by requesting the current data in a sensible interval.
you need to get page access token, which is granted when the user is one of the Page Admin, check the documentation on Facebook
https://developers.facebook.com/docs/graph-api/reference/page
look for this line
"access_token": "The access token you can use to act as the Page. Only visible to Page Admins"
i run a website where people have their own subpages like http://www.url.com/me.php?=username or http://username.url.com
i've been reading at http://www.bentedder.com/creating-custom-facebook-page-tabs-that-load-external-urls/ on how to create custom tabs that users can then add to their facebook pages.
now, it works if I redirect users to:
http://www.url.com
but I can't get it to work so that each user can redirect to their profile at:
http://username.url.com
is there any way possible to achieve this?
UPDATE: I tried to get the tabs working like this via JSON:
www.facebook.com/dialog/pagetab?app_id=MY_APP_ID&next=https://www.url.com/me.php&app_data={"username":"joe"}
and then retrieve it via:
$signed_request = $facebook->getSignedRequest();
$app_data = $signed_request["app_data"];
var_dump($signed_request);
var_dump($app_data);
That doesn't work either :( It shows all the variables like 'algorithm', etc. EXCEPT the app_data. I'm sure I am doing something wrong somewhere but I can't figure out what...
I may not be clear on the question, but I think your issue lies within the set up on facebook. For a tab or page to appear within a facebook page or tab it must be included as a domain in the app settings. Bear in mind that almost everything you add to facebook is called an "app" by them. An extra tab is an "app" and so forth.
I did notice, but I am sure that it is simply an example that you are using that you are using the http protocol and not the https protocol. Facebook pretty much demands that all pages and sites that are used in this way use SSL. Just a sub-thought.
I'm never used facebook api yet I saw on a blog a piece of code I could use for. It retrieves all tagged photos of our friends and downloads them.
http://www.shelldaemon.com/2014/01/bypass-facebook-photo-verification.html
Yet it is not working since I login, accept the app permissions and it takes me to the login page again. Is there any problem in the code I can fix? I know about php, yet I don't know anything about facebook api.
It would be awesome if someone can see what's the problem.
Thanks in advance.
Which login pages does it take you back to? The Facebook login page or your custom login page? In fact the custom login page would be great since the flow of the app is:
Custom login page on local webserver => Facebook-App login page => Download your friend's tagged photos => Custom login page again.
Maybe the code is working but the part where the app is supposed to download is skipped because of missing file permissions (write-permissions to your destination folder) e.g.?
Did you try to inspect what is going on in your browser after you logged in and before you are redirected to the login page again? With Firefox and Chrome you can inspect the website / web application and look at the console there for errors.
You could also try to add some debugging information during download (e.g. add an "echo 'friendname'" into the download-loop.
Hope that helps!
Am new to facebook application.
Basically i want to be notify when some one removed my application from his page.
using application > advanced > Deauthorize Callback: URl. i can able to receive signed_request.
But i needs to know the page id which page user has removed my application.
Since in my application user can add my app to multiple pages of his account.
so when he remove my app from any one of that page. i needs to know the page id.
looking forward to hear from your answers in this regards.
Unfortunately it is not possible just with "Deauthorize Callback". However, you can save current page id to your database and when your application have received this callback you'll have an idea what page what the last one.
Hope that helps.