jgorset / facebook-messenger

Definitely the best way to make Bots on Facebook Messenger with Ruby
MIT License
962 stars 211 forks source link

(#283) Requires manage_pages permission to manage the object #220

Closed 4ndv closed 5 years ago

4ndv commented 6 years ago

I'm getting following error when trying to call "subscribe" method:

(#283) Requires manage_pages permission to manage the object

Looks like i can subscribe my bot to the page from the "Webhooks" screen of the app

redjoker011 commented 6 years ago

same here having same issue for newly created App and Page.

Facebook::Messenger::Subscriptions::Error: (#283) Requires manage_pages permission to manage the object

redjoker011 commented 6 years ago

resolve this issue by manually subscribing your page into App Webhooks, under webhooks section in App -> Messenger -> Settings đź‘Ť

amrutjadhav commented 6 years ago

@4ndv @redjoker011 If you want to subscribe the bot to your own pages, then just do as per above comment as it is the simplest one. But if you want to deploy bot as a service, and let other users to subscribe to their pages, then you have to use this subscribe endpoint. In that case, you also have to do the app review for manage_pages permission.

jainsourabh2 commented 6 years ago

@redjoker011 @amrutjadhav I am facing the same issue but I am not able to grant manage_pages permissions manually. Please help.

amrutjadhav commented 6 years ago

@jainsourabh2 Can you please describe why you are not able to give manage_pages permission manually through facebook developer dashboard?

jainsourabh2 commented 6 years ago

@amrutjadhav I am not able to understand the steps mentioned by @redjoker011 . It will be great if you can help me on the same.

Under App Review , I have to do a submission for manage_pages permission and facebook will approve the same which i feel is a longer process just to test my chatbot integration with facebook.

amrutjadhav commented 6 years ago

@jainsourabh2, You don't need app review for manage_pages until your app is in development mode. Because while in Development mode, apps are automatically approved for all login permissions, features, and product-specific features. But if your app is live, and app review is not done, then it will show error while logging in. For adding extra permission to live app, go through this link.

jainsourabh2 commented 6 years ago

@amrutjadhav I am getting issue as mentioned in this thread because manage_pages permission is not available even though my app is in development mode.

https://github.com/botpress/v12/issues/396

(#283) Requires manage_pages permission to manage the object at /home/ec2-user/botpress/node_modules/@botpress/channel-messenger/bin/webpack:/src/messenger.js:621:15 at PassThroughHandlerContext.finallyHandler (/home/ec2-user/botpress/node_modules/bluebird/js/release/finally.js:56:23) at PassThroughHandlerContext.tryCatcher (/home/ec2-user/botpress/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/ec2-user/botpress/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/home/ec2-user/botpress/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/home/ec2-user/botpress/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/home/ec2-user/botpress/node_modules/bluebird/js/release/promise.js:693:18) at Async._drainQueue (/home/ec2-user/botpress/node_modules/bluebird/js/release/async.js:133:16) at Async._drainQueues (/home/ec2-user/botpress/node_modules/bluebird/js/release/async.js:143:10) at Immediate.Async.drainQueues (/home/ec2-user/botpress/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:810:20) at tryOnImmediate (timers.js:768:5) at processImmediate [as _immediateCallback] (timers.js:745:5)

amrutjadhav commented 6 years ago

@jainsourabh2 🤔interesting! Because in the Facebook clearly says that all the permission are approved default, for apps in development mode and I am also using manage_pages for my app in development mode, without app review. https://developers.facebook.com/docs/apps/review#app-review-for-live-apps

jainsourabh2 commented 6 years ago

@amrutjadhav can you please try creating a new app and confirm if it still allows manage_pages permissions? Just want to confirm if i am missing anything.

amrutjadhav commented 6 years ago

@jainsourabh2 ok. I will check and let you know.

jainsourabh2 commented 6 years ago

@amrutjadhav Any luck?

amrutjadhav commented 6 years ago

@jainsourabh2 I tried by creating new app in development mode but I didn't get any error for permissions.

jainsourabh2 commented 6 years ago

Thanks, but did the new facebook app had manage_permissions? I am getting the below permissions by default

image

For manage_pages permissions , it needs an app submission review

image

amrutjadhav commented 6 years ago

@jainsourabh2 No. email and default are the only default login permissions.

jainsourabh2 commented 6 years ago

@amrutjadhav How do I get manage_pages permissions for my app? I will have to do submission,correct?

amrutjadhav commented 6 years ago

@jainsourabh2 you don't. All the permission are accessible in development mode. So just go straight to login flow and ask for permission from user. But the user which is logging in should be added as tester for the app.

dmk23 commented 5 years ago

I am seeing manage_pages permission error too

Has anyone here been successful in applying for / obtaining it? What kind of info did you submit?

Keeping the app forever in dev mode is obviously not an option...

jainsourabh2 commented 5 years ago

@dmk23 for production environments, you will have to apply for app review with required permissions.

We can check with alex on help.botpress.io portal as to why this permission is really needed because other chatbots dont ask for it.

dmk23 commented 5 years ago

@jainsourabh2 yes, and my question is about how apply so that it gets approved

Can you link to the specific post on help portal you are referring to?

amrutjadhav commented 5 years ago

@dmk23 https://developers.facebook.com/docs/apps/review Go through this page to get information of app review process. For applying new permission

  1. Go to App Review tab of developer panel.
  2. Click the Add Items button under Current Submission section.
  3. Select the permission which you want to apply for from the list.
  4. After selection, click Add Details link of that permission.
  5. Here FB will ask for all the information they need for that permission. You have to fill up that information. Information is depends on the permission you applying for.
  6. After filling up all information, just submit it. FB will review your request and approve/disapprove it.

Image of developer panel for reference. https://imageresize.org/view/487e7953-d665-4cb5-a080-5c660d662ef8

4ndv commented 5 years ago

Just remove “subscribe” call in the code and subscribe manually

dmk23 commented 5 years ago

@amrutjadhav I am well aware of this process

The issue is that Facebook is picky about the reasons you are asking for manage_pages permission and has been denying my submissions time after time

What I am asking are some actual examples of submissions that got approved, not the basics

remy-burney-pf commented 5 years ago

It's just a freaking chicken and egg problem.

I cannot get webhook page notification if the app is not "live". So I put the app live, but then to reply to posts I need publish_pages permission, and so I need to go through the app review process. But Facebook won't approve my app because it's not finished, still in dev, and I cannot provide them with a video showing how I use and need the permission. It would be so much easier to be able to receive webhook page notifications in development mode...

facebook_publishpages

FACEBOOK ... PLEASE FIX !

amrutjadhav commented 5 years ago

@Remy-Burney-Powerfront Do you want to get real time Facebook page notifications such as activities /updates on your page, to your webhook?

If yes, then according to document, you should be able to get if user, having mentioned role subscribe app to page. Although apps in development mode are automatically approved for all login permissions, they will not receive live Webhooks notifications unless the person who installed the app has an Admin, Developer, or Tester role on the app. https://developers.facebook.com/docs/graph-api/webhooks

remy-burney-pf commented 5 years ago

@amrutjadhav I'm an admin on the page and on the app, but no luck there. Not sure what I'm missing. I'm wondering if others have similar issues for new apps.

amrutjadhav commented 5 years ago

@Remy-Burney-Powerfront Ohh. That's really strange then. I would suggest to open issue on facebook bug forum as it is more platform related issue, not related to gem. https://developers.facebook.com/support/bugs/

hdkcreative commented 5 years ago

@Remy-Burney-Powerfront Do you want to get real time Facebook page notifications such as activities /updates on your page, to your webhook?

If yes, then according to document, you should be able to get if user, having mentioned role subscribe app to page. Although apps in development mode are automatically approved for all login permissions, they will not receive live Webhooks notifications unless the person who installed the app has an Admin, Developer, or Tester role on the app. https://developers.facebook.com/docs/graph-api/webhooks

this was modified !

https://support.supermetrics.com/support/solutions/articles/19000080422-facebook-insights-error-283-requires-manage-pages-permission-to-manage-the-object

The error is related to the recent changes that Facebook made to their APIs in the wake of Cambridge Analytica.

remy-burney-pf commented 5 years ago

@hdkcreative, I think this article you mentioned does not change things. You still need to get the application approved to get the permission with webhooks working. In facebook app dev mode, you still don't get the webhook notifications, unless you go live.

hdkcreative commented 5 years ago

In facebook app dev mode (in this moment - today - now) .... the message is :

{ error: { message: "(#283) Requires manage_pages permission to manage the object", type: "OAuthException", code: 283, fbtrace_id: "C8iCtaqGa+D" } }

https://developers.facebook.com/docs/facebook-login/permissions/#reference-manage_pages

manage_pages Requires App Review.

Grants an app permission to retrieve Page Access Tokens for the Pages and Apps that the app user administers. Apps that allow users to publish as a Page must also have the publish_pages permission.

Allowed Usage Publish content to Pages owned by the people who use your app. Publishing also requires the publish_pages permission.

Help people manage the posts, comments and likes published to their Pages.

charboiv20 commented 4 years ago

@dmk23 we you able to get permission to Manage_Pages?

I need to submit the app review application before the 23rd, and don't know how to justify Manage_Pages. I have a chatbot, I'm not sure Why I need Manage_Pages, but I know I need it, and don't know how to justify it. Can you help?

Screen Shot 2019-10-20 at 11 59 30 AM
remy-burney-pf commented 4 years ago

@charboiv20 If it's just a chat bot you shouldn't need _managepages permission for your app. You really only need _pagesmessaging What makes you believe you need this permission if you don't know why you need it.

As per the facebook doc it is used to publish content to your FB page, manage the posts, comments and likes. If your chat bot only use facebook messenger, you don't need this permission.

charboiv20 commented 4 years ago

We have corporate page that we manage called accuweather. The bot is connected to it. I just joined this product team, the previous product manager had requested access but I can’t find out why. Would there be a link there?

remy-burney-pf commented 4 years ago

The bot is connected to it.

So what does the bot do with those pages ? This is basically what Facebook is asking in this app permission review form. You just have to explain what the bot is doing and why it's doing it. Then you have record a video showing the bot in action, like posting a message on the page as a result of an external action. For example, everyday the bot will post the weather forecast on the page.

charboiv20 commented 4 years ago

Okk. People need access to the bot from the page, would that be why?

AnimeshPandey123 commented 4 years ago

Wouldn't we require manage_page to get access token of page with app access token? I would not want to use user access token every time I require page access_token. Page access token is required to send message to user (or reply them).

neerajsaxena0711 commented 4 years ago

Can someone help me out with this - I have followed "Instagram Graph API" documentation, and requested all the permissions mentioned in it. Flow - email', 'public_profile', - Default permissions. 'instagram_basic', 'pages_show_list', 'instagram_manage_insights - Required permissions "mentioned" in the documentation - https://developers.facebook.com/docs/instagram-api/getting-started

It worked fine. I was able to login, select pages that I own (pages_show_lislt), upon selecting the correct page connected to Instagram, I could get the "basic" and "insights" of that account.

I submitted my app for review, got approval for all the requested permissions. But now when I switch to LIVE mode, it shows me this error

"error":{"message": (10), this endpoint requires the 'manage_pages' permission or the 'page pubic content access' feature}

Now why doesn't this error show up in development mode? Also if I include "manage_pages" permission in my facebook login request permissions, it gives me an error - "cannot ask for both read and publish permissions facebook".

How do I solve this?

brandnamewater commented 4 years ago

I'm receiving the same error.

Using fb api v6.0

I am in dev mode just looking to test out sending and or replying to messages from a Page

I added Messenger >> Settings >> Add Page >> Generate Token

Save that token to credentials:

Facebook::Messenger::Subscriptions.subscribe(access_token: Rails.application.credentials.dig(:facebook, :access_token), subscribed_fields: %w[feed mention name])

Start app and then get: ...manage_pages (Facebook::Messenger::Subscriptions::Error)

Everyone is saying to manually subscribe through settings but there is no option for this, unless what you mean is to generate the access token.

Anyone solving this issue as of lately?

I notice the Messenger >> Settings page shows to add a webhook url along with a token. IS this new because no tutorials are showing this for this gem?

brandnamewater commented 4 years ago

Anyone coming across this:

You cannot subscribe (to my knowledge and current uses experience) with apps in development mode (I am not speaking production but seems like it's solved above for that)

You must add a facebook account to the roles, then use that same facebook account to message the page you are testing on.

You may also need to create webhooks with a self-created token with the url "example.com/bot" (or whatever else you mount to. I am not positive if this is a needed step because I did it and then added a secondary facebook account to the roles, send the message, and it worked.

udoyen commented 4 years ago

@Remy-Burney-Powerfront Do you want to get real time Facebook page notifications such as activities /updates on your page, to your webhook?

If yes, then according to document, you should be able to get if user, having mentioned role subscribe app to page. Although apps in development mode are automatically approved for all login permissions, they will not receive live Webhooks notifications unless the person who installed the app has an Admin, Developer, or Tester role on the app. https://developers.facebook.com/docs/graph-api/webhooks

I am also have this same now, the api request to create a test account with the test user is telling my I need to add the "pages_manage_metadata" but I have added this and to make matters worst the token will expire and I start all over again!

corsoabl commented 4 years ago

Hello, I'm starting the integration of Instagram with Facebook, and I have the same problem, any solution?