Facebook Graph API 和朋友的电子邮件 [英] Facebook Graph API and friend's email

查看:32
本文介绍了Facebook Graph API 和朋友的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

StackOverflow 上有一些关于 facebook & 的问题电子邮件,但在阅读它们后,我仍然无法检索用户的电子邮件.

我们的应用在 Flex 上实现并使用 REST API.以前它使用notifications.sendEmail.应用具有 publish_stream 和电子邮件权限(通过 users.hasAppPermission 检查).

我尝试过 users.getInfo 来获取 proxied_email 地址.但是这个函数不会返回朋友的电子邮件地址..

然后我使用 Graph API 和网络浏览器进行了以下测试:

  1. 打开以下链接以获得具有扩展权限的授权:<块引用>

    https://graph.facebook.com/oauth/authorize?client_id=[app_id]&scope=publish_stream,offline_access,email&redirect_uri=http://www.facebook.com/connect/login_success.html

返回获取access_token的代码

  1. 打开以下链接以检索 access_token

<块引用>

graph.facebook.com/oauth/access_token?client_id=[app_id]&client_secret=[secret]&code=[code]&redirect_uri=http://www.facebook.com/connect/login_success.html

它返回了 access_token.现在我可以使用 GraphAPI.

  1. 已使用我的帐户进行测试

<块引用>

graph.facebook.com/me?access_token=[token]

好的.它返回了我的 emal.

  1. 与我的朋友一起测试<块引用>

    graph.facebook.com/[friend_id]?access_token=[token]

这里没有电子邮件字段!

所以我的问题是

我哪里做错了?是否可以通过 Facebook API(GraphAPI 或 REST API)获取朋友的电子邮件?

谢谢.

解决方案

电子邮件权限仅允许访问您的电子邮件.

如果您查看扩展权限页面,它会说:

<块引用>

同样,为了保护未明确授权您的应用程序的用户的隐私,您的应用程序将只能访问用户朋友的基本个人资料信息,例如他们的姓名和个人资料图片.如果您的应用程序需要访问有关用户朋友的其他数据以启用社交功能,您将需要请求下面列出的一些特殊的朋友权限.

如果您查看下表,它会显示朋友的电子邮件权限不可用".

There are some question on the StackOverflow about facebook & email, but after reading them I still have a problem with retrieving users emails.

Our app implemented on Flex and uses REST API. And previously it used notifications.sendEmail. App has publish_stream and email permissions (checked with users.hasAppPermission).

I tried users.getInfo for get proxied_email address. But this function does not return email address of the friend..

Then I performed the following test using Graph API and web browser:

  1. Opened the following link for authorization with extended permissions:

    https://graph.facebook.com/oauth/authorize?client_id=[app_id]&scope=publish_stream,offline_access,email&redirect_uri=http://www.facebook.com/connect/login_success.html

It returned code for retrieving access_token

  1. Oppened the following link for retrieving access_token

graph.facebook.com/oauth/access_token?client_id=[app_id]&client_secret=[secret]&code=[code]&redirect_uri=http://www.facebook.com/connect/login_success.html

It returned access_token. And now I can use GraphAPI.

  1. Tested with my account

graph.facebook.com/me?access_token=[token]

Ok. It returned my emal.

  1. Tested with my friend

    graph.facebook.com/[friend_id]?access_token=[token]

And here is no email field!

So my questions are

Where did I go wrong? Is it possible to get friend's email via Facebook API (GraphAPI or REST API)?

Thanks.

解决方案

Email permission gives access to your email only.

If you look at the extended permissions page it says:

Likewise, to protect the privacy of users who have not explicitly authorized your application, your application will only be able to access the basic profile information about a user's friends, like their names and profile pictures. If your application needs to access other data about a user's friends to enable social functionality, you will need to request some of the special friends permissions listed below.

And if you look at the table below, it says "not available" for email permission for friends.

这篇关于Facebook Graph API 和朋友的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆