Get list of user's friends using my app and offline publishing to user's stream - facebook

I need to perform a couple of actions when the user is logged off Facebook.
First i need to get a list of a given user friends using my application.
Second i need to be able to post messages to user's feeds offline as well.
What kind of permission do i need for that?
How do i achieve it using the Open Graph and the new oAuth 2.0?
What happens if the user initially grant the required permissions but between that and my
app doing the offline work the user revoke them?
How can i check for that?
Thanks everyone!

Ask for the offline_access permission.
It's being deprecated but there's workarounds with the latest information as of yesterday that allows us 60 days of access using a token. See: https://developers.facebook.com/docs/offline-access-deprecation/

Related

Getting a long-lived User Access Token for Instagram Graph API

We are building a mobile app on behalf of a corporation and the API needs to be able to return the corporation's Instagram feed. We have found that implementing what should be a simple requirement incredibly difficult.
We need to retrieve the following Instagram post data from the corporation's feed:
image url
caption
url to post
timestamp
With this in mind we identified that we need to use the Instagram Graph API which means there are strict requirements around permissions.
Note: We are open to using any method that returns us the required data.
Using the Instagram Graph API we need to use the following endpoints:
Media (to get a list of the latest IG Media objects for a user)
IG Media to get detail about each media object
This works fine but the problem lies with getting a long-lived User Access Token. To get this kind of token we need the instagram_graph_user_media permission. The Long-Lived Access Tokens documentation says:
Long-lived tokens are valid for 60 days and can be refreshed as long as they are at least 24 hours old but have not expired, and the app user has granted your app the instagram_graph_user_profile permission.
How can the app user (the corporation) grant the app the permission? As I mentioned this is for an app on behalf of a corporation.
Any help here would be really appreciated!
Thanks
Did you go through the App review process in Facebook? Whenever there are user permissions involved, you need to go through the App review process for your app. Even though you don't use user permissions, some user permissions are pre-requisites for some business permissions.
Read the article here for more information: https://developers.facebook.com/docs/app-review
Unsure if this will be of any help, but battling exactly the same thing today came across this and it made for some intresting reading https://solrevdev.com/2020/05/28/instagram-basic-display-api.html

How to get planned events of a user using Facebook Graph API

I need to display on a website the planned events of my facebook user account.
I use this link, with the access token of my app.
https://graph.facebook.com/{$fb_user_id}/events/attending/?access_token={$access_token_app};
I tried several times with different accounts, but I always get an empty data array, or only events that were created by the account itself.
Maybe it's because the access to planned events of a user is restricted ?
Do I need a particular access_token ? Or an authentification ?
Thank you for your help !
You need the 'user_events' permission granted to be able to view a user's events. Have you checked that?

What is needed to access another user's facebook posts ("App Not Setup")

I have a desktop app which uses a user access token to read the me/feed endpoint and I can see all the posts for the logged in user. If I wanted to simplify deployment to different users I would need to minimise the amount of setup/configuration they did.
Is there a way to access me/feed for a given userid rather than have to setup every user as a developer account and create an app for it?
I have looked at https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0 and it is not obvious to me how to do this.
What configuration / permissions does the user in question need to do to activate this. Which access token should I be using, and will it give access to all the posts in the same way the user access token does.
[EDIT] I have looked at this again and the problem I am having is that when a user (who has a facebook account but is NOT a developer) tries to login to my App (which is in development mode) I get the following error
"App Not Setup: The developers of this app have not set up this app properly for Facebook Login."
Thanks in advance

Is it possible to view/download the content of the POST done via my facebook application?

I have a scenario, where an authorised user through my application is posting status/uploading pictures via my application by granting required permissions. My application uses graph APIs.
Now, as app administrator if I want to see the content of the post, that the user has uploaded via my application. How do i do it?
I know in graph APIs, I have INSIGHTS api. But, it just gives us the statistics of the posts done via my app or user.
Can i really see the posts?
Assuming as an app admin I only have app access token and app ID. I dont store user access tokens with me.
Actually, I worked on the problem with every possible way. Found out that, even being an APP administrator I will need user access token (stored with me), without which these data shall not be retrieved via APIs.
My need was not to use user access token; But, no Its not possible via APIs as of now.

How long can I access a friend's list offline after that person connects via facebook connect?

I want be able to send a list of friends & recent additions from someones facebook account to an email address daily or weekly.
Looking up online, I think the best approach would be to setup a website, where a user would facebook connect with their facebook credentials & accept all terms including accessing their friends list. The website would then run a batch job nightly to access that persons friend list, do a matchup and then send an e-mail with the summary of their findings.
Is this possible? Can I just do a onetime login and get forever access to someones friend list, assuming they do not manually revoke access to the application within fb? looking for suggestions. I know there is way to access a profile offline, but how long is that session available for? I know the policy has changed, AND can change in the future by trying to understand the current state of accessing a friends list offline.
Also, am I violating any policies by doing this?
You need to ask the user for an offline_access permission and read_friendlists permission, that way you'll get an accessToken that does not expire.
More info here: http://developers.facebook.com/docs/authentication/permissions
as long as you don't save data you'll be fine