Charca / bootbot

Facebook Messenger Bot Framework for Node.js
MIT License
974 stars 253 forks source link

Get users email #102

Closed jaksz closed 6 years ago

jaksz commented 6 years ago

We can get the users profile with chat.getUserProfile(), but how can we get the email?

mraaroncruz commented 6 years ago

Here's an article about it. It looks like a real pain. Look in the comments, there's some good stuff. http://espeo.eu/blog/user-permissions-messenger-bots/

Also look here https://developers.facebook.com/docs/messenger-platform/webview/permissions I can't see anything about email here: https://developers.facebook.com/docs/messenger-platform/identity/user-profile

It looks like it's a bit of a black art.

mraaroncruz commented 6 years ago

Also check out this https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow linked to in this related thread in the botkit repo https://github.com/howdyai/botkit/issues/544

FnTm commented 6 years ago

@jaksz I'm quite certain that e-mail is not something you can get directly from the userProfile, and that is by design. Your best option is to ask the user to enter their e-mail directly in some way, though most users will most likely not do that.

Charca commented 6 years ago

Yeah, I don't think it's possible to get the user's email address from Facebook. This might change in the future, but right now your best option is to ask the user directly.