Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access tokens for Facebook #330

Closed
vushe opened this issue May 4, 2018 · 28 comments
Closed

Access tokens for Facebook #330

vushe opened this issue May 4, 2018 · 28 comments

Comments

@vushe
Copy link

vushe commented May 4, 2018

Hello,

could anyone kindly shed light on how to get access token for a Facebook feed?

Is the token available in example permanent and unlimited for all of us utilizing social-feed.js?
I recently tried to obtain a new token from Facebook and, [how I got it], they demand app review to grant us permission to get feed.

@vushe
Copy link
Author

vushe commented May 7, 2018

And default token doesn't work anymore, of course. I suggest either not to confuse people with Facebook support or provide a clear instruction on how to get a token.

@HartLarsson
Copy link
Contributor

Hi, as usual to get "APP_ID" and "APP_SECRET" you need to create an APP like explained here: http://www.bloggingshiksha.com/how-to-get-app_id-and-app_secret-key-for-facebook-applications/

Keep in mind that Facebook has changed API version so you need to edit the socialfeed.js script and change the script as explained here (frm v2.4 to v2.12) #326

@vushe
Copy link
Author

vushe commented May 8, 2018

Thanks for reply and instruction! I followed it, but, unfortunately, no luck. Below is the message returned when using API v2.12.

I asked Facebook for necessary permissions, but request rejected.
Note that app token of social-feed.js is basically working fine (unless (#4) Application request limit reached is returned).

Message:

{
    error: {
        message: "(#10) To use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.",
        type: "OAuthException",
        code: 10,
        fbtrace_id: "H+MhBEqBn09"
    }
}

@martijngastkemper
Copy link
Collaborator

martijngastkemper commented May 9, 2018

Do you still have this problem after the update to Facebook V2.12?

@vushe
Copy link
Author

vushe commented May 10, 2018

Well, as I mentioned before, I have trouble with v. 2.12 as well.

I can only imagine that Facebook's policy for new tokens (or new developers) is changed.
Old tokens are still working, however newly generated ones aren't with message returned:

(#10) To use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.

@mistafi
Copy link

mistafi commented May 12, 2018

You are definitely not alone. Since the update to v3.0, I have tested a handful of newly generated tokens and none of them work.

@kierweb
Copy link

kierweb commented May 12, 2018

Looks like new keys require an "App Review" - see "Page Public Content Access" at the bottom of this page .... https://developers.facebook.com/docs/apps/review/feature#reference-PAGES_ACCESS

@vushe
Copy link
Author

vushe commented May 14, 2018

Yeah, after one-day review my app was rejected completely. For some rights they even ask you to upload videos. So I cannot fetch data even for the group I'm administrating.

Can it be related to GDPR?

@Namstel
Copy link

Namstel commented May 14, 2018

Maybe GDPR, probably Cambridge Analytica scandal. We're also running into this problem.

@mistafi
Copy link

mistafi commented May 14, 2018

After you submit for review, you are asked to select permissions. "Page Public Content Access" seems appropriate. Then you are prompted with this:

Details for Page Public Content Access
Please explain how you are using Page Public Content Access to enhance the experience of your app.

Your app doesn't have any platforms listed. You'll need to add at least one platform in Settings before you can continue.

What platforms does your app use Page Public Content Access on?
Web
Mobile
Other

Upload screencast
We need to see your app using Page Public Content Access so we can see that it doesn't violate our policies. Upload a video screencast walkthrough using any method, (even recording with your phone).

You must show:
How a person logs in with Facebook
How a person sees this feature used in your app

Drag your screencast file here to upload Choose a file to upload...

Need help with screencasts? See examples and instructions here

Before you can submit for review, complete the following:
Please provide a reason for why you are using this feature.
Please provide instructions for how to reproduce this feature.
Please provide a screencast that shows how this feature is used in your app

@mistafi
Copy link

mistafi commented May 14, 2018

But yet...there is also this:

Which permissions require review?
Review is not required to ask for the two basic permissions: public_profile and email.
Review is required to ask for any other permissions when people log into your app

So why aren't the tokens working? (thinking out loud and hoping for an answer)

Edited:
Facebook permissions are confusing. They do not mean what you think they mean.

It appears we need both the "user_posts" and "Page Public Content Access" permissions to be granted.

I'm currently working on submitting one of these reviews and will report back.

@kierweb
Copy link

kierweb commented May 14, 2018

Noticed this bit ..

"While testing and before submitting for review, your app may only access content that is available on a Page that you own. If you want to access public content on other Pages, you must submit this feature for review."

So how do you get the app to own a page!?

@mistafi
Copy link

mistafi commented May 14, 2018

Possible fix, tested and currently working: go to

https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=me%2Ffeed&version=v3.0

and grab the token it generates from here.

Also noted in #337

@vushe
Copy link
Author

vushe commented May 14, 2018

Thanks @mistafi. Unfortunately, token generated is temporary and valid just for a few hours.

@mistafi
Copy link

mistafi commented May 14, 2018

Thanks @vushe. I suspected it might be, but I couldn't find anything in the documentation about the time limit. Would you mind pointing me in that direction?

Edited: Found the expiry. Snap.

@vushe
Copy link
Author

vushe commented May 14, 2018

Just in case, you need to click small lightblue info button on the left.

image

I suspect this plugin is dead for Facebook :(

@kierweb
Copy link

kierweb commented May 14, 2018

Not just this plugin, any plugin which uses Facebooks API system!

@mistafi
Copy link

mistafi commented May 14, 2018

Does anyone know how we get the server side social feed piece to work?

https://github.com/pavelk2/social-feed-server

/facebook?url={the facebook graph request url without access_token and without ?callback}
/instagram?url={the instagram request url without client_id and without ?callback}
/google?url={the google + request url without access_token and without ?callback}

@vushe
Copy link
Author

vushe commented May 14, 2018

Example:
https://graph.facebook.com/v2.12/PAGE_ID/posts?fields=id,from,name,message,created_time,story,description,link,picture,object_id&limit=LIMIT&access_token=TOKEN&callback=

@mistafi
Copy link

mistafi commented May 14, 2018

I'm having some trouble forming the URL based on this and figuring out how this fits in with the current plugin.

I've tried this, but not getting a return:

https://www.facebook.com?url=https://graph.facebook.com/v2.12/PAGE_ID/posts?fields=id,from,name,message,created_time,story,description,link,picture,object_id&limit=3

@vushe
Copy link
Author

vushe commented May 14, 2018

Why don't you remove this https://www.facebook.com?url=?
The link I posted previously should return a json object.

@mistafi
Copy link

mistafi commented May 14, 2018

Hey @vushe, thanks for the direction. I tried using the call without the token and callback. Instead of a JSON object, I received Oauth errors. It still says you need a token.

Facebook. Sigh. lol

@vushe
Copy link
Author

vushe commented May 17, 2018

It's worth mentioning that juicer.io still works fine with Facebook.

They have free plan with basic restrictions. Maybe for someone like me this is a good substitute for social-feed.js. Paid plans are quite irrelevant for basic users but normal for companies. But good point is that you don't need to deal with tokens. Everything's primitively simple.

Feed example is here.

@vushe
Copy link
Author

vushe commented Jun 5, 2018

I'm not with Facebook anymore, but reportedly API works fine now.
#337

Closing.

@vushe vushe closed this as completed Jun 5, 2018
@PauloPeres
Copy link

Hi Guys.... I Made a video on how to get the Access token if you are doing this for a Facebook Fanpage. i Hope it helps.

https://youtu.be/--vfXv6OmTE

@kierweb
Copy link

kierweb commented Aug 8, 2018

These access tokens are only valid for a couple of hours.
"Expires | 1533722400 (in about an hour)"

@HartLarsson
Copy link
Contributor

@PauloPeres your method is wrong you get a temporary access token that is valid for a limited time.
Is good for fast debugging.
For a permanent TOKEN you need to create a Facebook APP and inside the APP use the ID/TOKENS created.

@PauloPeres
Copy link

Shit I'm doing a job for a client and Facebook does not accept my application

@vushe vushe reopened this Aug 13, 2018
@vushe vushe closed this as completed Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants