Closed rafayet-monon closed 5 years ago
@rafayet-monon facebook-messenger-0.11.1 gem works on graph API v2.6 and as of July 13, 2018, this API is unavailable. So I would suggest you, use facebook-messenger-1.1.1 which works on graph API v2.9. And graph API v2.9 don't need subscribed_fields
parameter while subscription.
@amrutjadhav i got the same issue and switch to facebook-messanger-1.1.1, but i'm still getting the same error:
.rvm/gems/ruby-2.4.2/gems/facebook-messenger-1.1.1/lib/facebook/messenger/subscriptions.rb:73:in raise_errors': (#100) The parameter subscribed_fields is required. (Facebook::Messenger::Subscriptions::Error)
Same here, also got the problem after switching to 1.1.1. @amrutjadhav . Are we missing anything. It would be a big help if you pointed out.
@rafayet-monon It's very strange. Because currently I am using facebook-messenger-v1.1.1 and everything is working fine for me. If you share your code/sample, I could check it out.
@amrutjadhav Actually I am trying to run this project with api-ai. here is the gist that contains connection to subscription.
@rafayet-monon Sorry, but I couldn't understand the reason behind your error as the shared code looks correct. And documentation of subscription on Graph API v2.9 also don't require subscribed_fields
. I would suggest you to check FB developer panel and check whether everything is OK. You could also try by creating a new app and check if the error still exists.
hello guys! I faced with a similar problem. my FB application created with API v3.2 and I assume this problem happened, because of FB API v3.1+ require subscription_fields (https://developers.facebook.com/docs/graph-api/reference/page/subscribed_apps#Creating).
I think if add the second defined parameter to subscribe
method, like
def subscribe(access_token:, subscription_fields: [])
it will fix the problem
but I could be wrong
@jgorset I think, it will be helpful https://github.com/jgorset/facebook-messenger/pull/232
Same problem guys :(
Same problem too ^^' Facebook has change API 2.9 to 3.2. Maybe it's that.
Guys,
Does anyone found a solution? I got the same error on Heroku: "(#100) The parameter subscribed_fields is required. (Facebook::Messenger::Subscriptions::Error)" ?
Best regards, Fred.
OK!; Just remove 'Facebook::Messenger::Subscriptions.subscribe(access_token: access_token)' And working good.
This is happening because this endpoint targets Graph API 2.9, but new apps no longer support targeting that. We'll need to upgrade the endpoint to using Graph API 3.2, and implement support for subscription_fields
to the subscribe
method.
You were onto something, then, @artyomlagun! In fact the only thing you didn't do was to upgrade the version in the endpoint! If you revise your pull request, I'll be happy to merge it.
Here are the options for an app created a long time ago
Here are the options for an app created today
Any updates on this? Did anyone manage to make this work? We're getting the same subscribed_fields is required
error :(
@artyomlagun #232 (comment)
I used your gem, but seems you misnamed the parameter, or I don't know if it had another name on the previous version. I cloned it and changed the name (from subscription_fields
to subscribed_fields
), but then it still complains if the field is empty, though with another error:
Unable to load application: Facebook::Messenger::Subscriptions::Error: An unknown error has occurred.
But then if you specify one of the fields, it complains about permissions:
Unable to load application: Facebook::Messenger::Subscriptions::Error: (#200) To subscribe to the messages field, one of these permissions is needed: manage_pages
Any ideas?
I took @artyomlagun's pull request the rest of the way and released a new version 1.1.2 that should fix this issue.
If you are using Graph API v3.2 or upper version, please add one additional parameter in the POST request ,
subscribed_fields=leadgen
what's leadgen ?
@habipyesilyurt17 @stabgan
which params subscribed_apps use https://developers.facebook.com/docs/graph-api/reference/page/subscribed_apps#Creating - you able to see in the Parameters section (the leadgen on the 9th line from the bottom).
and you should call subscribe method like:
Facebook::Messenger::Subscriptions.subscribe(access_token: @page_token, subscribed_fields: SUBSCRIBED_PARAMS, page_id: @page_id)
your SUBSCRIBED_PARAMS should be:
SUBSCRIBED_PARAMS = [ 'messages', 'message_echoes', 'message_deliveries', 'messaging_optins', 'leadgen' ]
I took @artyomlagun's pull request the rest of the way and released a new version 1.1.2 that should fix this issue.
sorry, I've not seen your comment :) but I'm glad that my PR was helpful
I am facing this error with facebook-messenger-0.11.1.
`raise_errors': (#100) The parameter subscribed_fields is required (Facebook::Messenger::Subscriptions::Error)
How can I fix this error?