How to use facebook's Webhooks for non admin pages? - facebook-graph-api

Am trying to use Facebook's Webhooks for pages to get feeds and ratings notification. Am able to get notification if I'm the admin of the page but am not able to get any notification for the pages I'm not an admin, even though I hold the page access token which is been granted by the admin of the page to my App.
I tried calling
https://graph.facebook.com/v2.6/<page-id>/subscribed_apps?access_token=<page-token>
but got
{"error":{"message":"(#200) User does not have sufficient administrative permission for this action on this page.","type":"OAuthException","code":200,"fbtrace_id":"BzRm1gqdTBH"}}
In Facebook documentation, its mentioned "page-related RTU objects will require that your app be installed on the page". Have installed my App in the respective page as page tab. Still its the same.

Related

django redirect to other page and auto login to that page

Is there a way to redirect to other page and automatically log into that page?
So it's like I make django webpage with login and create link to facebook. When user clicks to facebook link, it should automatically login to his facebook page. Of course, I will have his facebook username and password on db I used to create the website.
Is this possible? Basically, I am trying to create interface page on django with link to several different webpage and make user access to his page by simply logon to this interface page alone.
I suggest that you have a look at the Django-allauth, which is an Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication
It does most of the things you want, you can go through the documentation
https://django-allauth.readthedocs.io/en/latest/index.html

What's the API full process for subscribing a Facebook page to an app?

I need to allow users to easily subscribe their Facebook page to my app (which uses webhooks).
I've found incomplete posts, largely talking about first gaining an access token for each page, but surely there must be a way to process this via the API, so it's easy for users? The process would be:
User clicks 'add my page' on my web platform
Redirects to Facebook, and asks user to select the page they wish to connect, and grant permission
Returns to my platform and adds the relevant info into the backend, ready for the incoming calls
Is there anywhere this flow is documented? I'm using the NodeJS SDK

Facebook permissions - login flow

I am facebook development newbie and have problems with understanding login flow.
What I want to achieve:
I need access app user's pictures from the album created by the
application (preferably also when users are offline).
I run through facebook samples and stackoverflow questions and what I managed to do is:
I use facebook authentication with user_photos scope as follows:
however the script retrieving list of albums gets an "An active access token must be used to query information about the current user." error.
So I added:
Grant Permissions to Allow access to Photos and Albums
The scope is exactly the same, so I don't understand why after clicking that button retrieving the albums works.
The problem is that after refreshing the page, app recognizes that I'm a user who uses the app, but the albums are not accessible again.
How can I make app to get the permission to access pictures permanently?
I suppose it should be possible to access them also when the user is offline (if the album is public)?
The problem was that script accessing data was loaded faster than the user was verified by facebook. It worked with a button just because clicking a button gave application needed time buffor.

facebook graph api logout after fetching profile details

I am implementing "login with facebook" feature using php sdk, i am able to grab user profile details. But after that user remains logged in. Suppose user is accessing my site and after using "login with facebook" features he leaves immediately, then next person sitting there can use(misuse) previous persons account.
1)How can i automatically logout user after fetching what i needed (I dont want to show user "facebook logout" button).
2) Is there any way i can only logout user from my app and not facebook logout ? (i mean if user is already using facebook in another tab then it should only logout users facebook session from my app.)
Assuming all the usual security measures are in place (session timeouts apply to FB logins, doesn't leak FB data across distinct PHP sessions, logging out of your site clears FB session data or moves to a login/front page with no FB access), websites with Facebook integration generally don't bother securing their FB integration on a per-request basis. It's the user's own fault if they leave a browser window open and logged into your website, there's not a lot you can or really should do about that kind of mistake.
All that being said, you can call getLogoutUrl and then redirect the user to that URL to log them user out of the current session, OR you can use the JavaScript SDK's FB.logout(). Both options are mentioned here.

Developing a Facebook app that will appear in Facebook pages

I want my Facebook app that I'm developing on, appears as an iframe in several fan pages that I have on Facebook.
is this possible to place a facebook app on a Facebook fan page iframe?
if so will my users need to approve my app on each page or will one-time approval for the app will approve it for him in all my fan pages?
Yes this is possible, please refer to Page Tab Tutorial and Apps on Facebook.com documentation for details on how to do this
User only need grant access to application once, on other Pages same application will get all user details (This isn't required, if you application doesn't need user identity to work, you can skip this at all)...
Facebook grants permissions by app id, so no matter how many pages you put that app in, it will only ask for perms on one page.