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

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

问题描述

关于facebook& amp;&  StackOverflow有一些问题电子邮件,但阅读完毕后,我仍然有检索用户电子邮件的问题。



我们的应用程序在Flex上实现并使用REST API。之前它使用notifications.sendEmail。
应用程序具有publish_stream和电子邮件权限(与users.hasAppPermission一起检查)。



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



然后我使用Graph API和Web浏览器执行了以下测试:


  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]


Ok 。它返回了我的emal。


  1. 通过我的朋友测试


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


这里没有电子邮件字段!


< blockquote>



所以我的问题是



我错了哪里?
是否可以通过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天全站免登陆