Reputation: 11
I have question about FB messenger bot, any help would be apriciated! I have a web application where we have FB login which gives us information about user and FB ID.
FB messenger also gives us an ID, but it's different from FB ID and I cannot find any connection between those 2.
Do we have a way to identify FB user by Messenger ID? Thanks!
Upvotes: 0
Views: 738
Reputation: 176
Yes there's a way actually, it's not official but I've been using it for a while now.
Just retrieve the profile picture of the user in both Messenger and FB app. Facebook provides profile pictures as URLs, and it's the same whether it's retrieved from Messenger or app.
So what you have to do is to store these URLs, and whenever you want to match profiles with Messengers, just compare the profile pictures links, and you'll be able to link your users profiles to their Messenger.
Upvotes: 2
Reputation: 96306
FB messenger also gives us an ID, but it's different from FB ID
Yes, it is called a page-scoped id (meaning it will be different for every page your bot runs on.)
https://developers.facebook.com/docs/messenger-platform/implementation#send_api:
These ids are page-scoped. These ids differ from those returned from Facebook Login apps which are app-scoped. You must use ids retrieved from a Messenger integration for this page in order to function properly.
and I cannot find any connection between those 2.
That’s because you are not supposed to.
Upvotes: 1