Open GKG4 opened 3 years ago
Any update on this small query, its no big deal to solve, just need to add LIMIT {variable}
@GKG4 We didn't have a chance to test it out. We will check it out and see if we can reproduce the error.
If you are comfortable with sending a Pull Request, please feel free to do it. We are happy to guide you.
You cant reproduce as its not an error, its about default limit of fetching FB Pages. Its fetching 25 pages only, and I have 40+ pages, therefore, you need to extend FB fetch code to increase this limit.
@GKG4 its not configurable via a variable. I think we would need to paginate through all the available pages for that account than stopping after the single API call
Apart from paginate, there is an option to set limit while querying, as per the Facebook Graph Explorer. You simply need to add Limit(100) or whatever number of pages you need to fetch, this will fetch in a single call without pagination.
@page_details = mark_already_existing_facebook_pages(fb_object.get_connections('me', 'accounts'))
if we change it to
@page_details = mark_already_existing_facebook_pages(fb_object.get_connections('me', 'accounts.limit(100)'))
it should work, however, since I am .net developer, I cannot compile or run this code. If you can test it, much appreciated.
@sojan-official Is there any chance that you will be fixing this issue? Because this is the only thing stopping me from using ChatWoot at the moment
I have few suggestions and if you are willing to discuss a bit, I am more than happy to contribute Open Source Windows version for Chatwoot, and probably Mac Version too.
@GKG4 Yes, We will be prioritizing it for our next week's issue intake.
We are always open to feedback. Please feel free to initiate a GitHub discussion/issue anytime for anything :) We are also available on discord: https://discord.gg/cJXdrwS
@GKG4 We don't restrict the number of Facebook pages in chatwoot. It's not related to the pagination or limit.
fb_object.get_connections('me', 'accounts') = returns all the pages connected your account, this is the command that we run and send it to facebook to get the connected pages.
The issue might be with the access permission that your account has to the other pages. https://developers.facebook.com/docs/facebook-login/permissions/overview/#granularpermissions
If you have configured this on the self-hosted version, and you have access to https://developers.facebook.com/tools/explorer/ then you can run the query me/accounts
and check the connected pages to the account like below.
Or you can go to https://business.facebook.com/latest/settings/business_assets to check the pages to which you have access.
cc @sojan-official
@tejaswinichile and @sojan-official
Its not you who is putting the restrictions. Its that if you do not set fetch limit, default number of pages FB send is 25. You need to provide either pagination or option to call more than 25 pages by adding limit variable into the queries.
I already have a custom app built in .net fetching all 40+ pages, therefore, I know that I have access to those pages.
As you can see the first screenshot, when I called /me/accounts
You will see the pagination at the end, however, when I called me?fields=accounts.limit(100)
There is no pagination. The error is not from your end, but its a limit from Facebook.
Hope I cleared my point here.
@sojan-official @tejaswinichile @pranavrajs
For the time being, I have a fix for this.
I noted the first 25 pages FB is sending, and then while Authorizing the app with ChatWoot, I deselected those first 25 pages, this way I got the remaining 15 pages (out of 40).
Then I added Inbox for those pages, one by one, and once the list was empty while Authorizing with Facebook, I edited the settings and authorized the remaining 25 pages. This way, I got all 40 pages in my ChatWoot. I know its not a solution but a workaround for the time being.
Cheers!!!
@GKG4 Thanks for posting back. Nice Hack. We will prioritize a proper fix :)
@sojan-official
As of now, we have 24 hours window to reply, after that we cant reply to FB Messages
However, Facebook to give option for 7 days window, if we use HUMAN_AGENT
tag
Is it possible, if you guide me, where I can add all these, I am willing to contribute? Also, I am willing to add different message templates as per Facebook API
@GKG4 I guess we need to append the human tag params to the message payload here
ref: https://developers.facebook.com/docs/messenger-platform/send-messages/message-tags/
curl -X POST -H "Content-Type: application/json" -d '{
"recipient": {
"id": "<PSID>"
},
"message":{
...
},
"messaging_type": "MESSAGE_TAG",
"tag": "ACCOUNT_UPDATE"
}' "https://graph.facebook.com/v12.0/me/messages?access_token=<PAGE_ACCESS_TOKEN>"
But we would need to assess and do the following
HUMAN_AGENT
permissions,HUMAN_AGENT
is enabledHUMAN_AGENT
would be happy to collaborate over a PR
@sojan-official Since HUMAN_AGENT do not require any additional permission, and since Chatwoot is usually human operated only, we can make it defafult as well.
@GKG4 "Human Agent permission is not available in standard access/dev mode. You will need to complete the app review process before you can leverage the human agent tag. During app review submission, please provide clear instructions and demo on how you intend to leverage the human agent tag in your experiences."
ref: https://developers.facebook.com/docs/messenger-platform/send-messages/message-tags/ I think we need to consider our community installations that run Facebook apps without going through the app review submission, using dev mode.
some news?
I have more than 40 Facebook pages, however, the self hosted version is fetching only first 25 pages. Is there any way to edit .env variable to set it to higher number?