问题
I'm having some trouble connecting people across apps and bots in messenger.
https://developers.facebook.com/docs/messenger-platform/connecting-accounts
I've already associated my developers facebook app (with a Facebook log in and Messenger Products) in Business, as well as the page.
My objective is in my server being able to identify the messenger user with the log in user in the app. So when the user would go to the messenger would have the same experience as in the app.
The trouble is: when I try to get ids_for_pages
from graph it returns the data empty, even after this user talks to the bot.
Graph GET (v2.10)
/{user_login_id}/ids_for_pages?access_token={user_login_access_token}&appsecret_proof={appsecret_proof}
{"data": []}
When I'm using the Page-Scoped ID I'm able to get ids_for_apps
(great I can use that to match the user if the user already log in to my app), but if the user talks to the bot and then goes to my app I see no way for me to match the user.
I also investigated on Business Mapping API with the token_for_business
but it is necessary the user node. Great in the app but I can't get the user token or user node by the Page-Scoped ID.
https://developers.facebook.com/docs/apps/for-business
Am I doing something wrong? A missing permission? My bot is live and has pages_messaging
.
Any guidance helps! Thank you for your time!
EDIT
As amuramoto said, I was using the wrong access_token
. It must be the same as I used in the ids_for_apps
.
/{user_login_id}/ids_for_pages?access_token={page_access_token}&appsecret_proof={appsecret_proof}
回答1:
Putting this here in case this questions comes up for anyone in the future.
You aren't using the right access token. The example in the docs show that calls to ids_for_pages
requires a page-scoped access token, not the user access token.
来源:https://stackoverflow.com/questions/45371955/getting-ids-for-pages-from-graph-returns-empty