如何获取Facebook中的用户电子邮件地址(Facebook Connect或Graph API)? [英] How to get the user email address in Facebook (Facebook Connect or Graph API)?

查看:213
本文介绍了如何获取Facebook中的用户电子邮件地址(Facebook Connect或Graph API)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前在Facebook上有一个FBML应用程序,现在使用图形API更改为FB中的IFrame应用程序。 (相同的名称,同一个游戏帐户,只需从FBML切换到iFrame)。



我有一个接受电子邮件的扩展权限列表。因为我更改为IFrame,我可以通过API被告知他们的电子邮件。



然而,这里是问题。



1)当在FBML中时,我没有他们的电子邮件。只有他们的电子邮件权限。 (这就是我的界限)



2)登录并访问我的应用程序时,我可以获取用户的电子邮件



3)但是,当我们不访问我的应用程序时,我无法获取用户的电子邮件。因为有些人可能不会回来,但我想告诉他们有关更新。



4)我试图使用我为应用程序注册的电子邮件地址(即开发者帐户)运行应用程序,但是我仍然无法检索他们的电子邮件。 p>

似乎应用程序只能获取当前的登录用户。即使我是管理员,我也无法收到他们的电子邮件。



有没有办法我可以这样做?



例如:
如果用户12345678并转到我的应用程序,我可以运行它可以得到他的电子邮件:

  $ fql =select user from user where uid = 12345678; 

显然,该用户无法运行并获取用户23456的信息。

 例如$ fql =select user from user where uid = 23456; < ---失败

所以,这里是问题。我有成千上万的人以前注册并接受延长的许可,我如何才能收到他们的电子邮件?
我不能运行这个...

  $ fql =从用户选择电子邮件,其中uid = 1000001; 
$ fql =select user from user where uid = 1000002;
$ fql =select user from user where uid = 1000003;
//假1000001 ... 1000003是那些用户。

我尝试使用我的开发人员帐户登录Facebook,但是仍然不会工作。
如果有人有解决方案,欣赏。谢谢。

解决方案

想法是在登录时获取用户的电子邮件,然后将其存储在您自己的数据库中,以备将来参考。


I previously have an FBML application in Facebook and now change to an IFrame application in FB, using the graph API. (under the same name, same game account. Just switch from FBML to iFrame).

I had a list of people with Extended Permission accepted for email. Since I change to IFrame, I can get their email... by what the API is told.

However, here is the problem.

1) When it was in FBML, I don't have their email. Only with their email permission. (that's what I was bounded)

2) I can get the user's email when they login and visit my application

3) However, I cannot get the user's email when they don't visit my application. Because some of them may not come back but I want to tell them about the update.

4) I tried to run the application using the email address I register for the application (i.e. the developer account), but still, I cannot retrieve their emails.

It seems that the application can only get the current login user. I cannot get their email even I'm the admin.

Is there any way I can do that?

For example: If a user 12345678 and go to my application, i can run this can get his email:

 $fql    =   "select  email from user where uid=12345678";

Obviously, that user cannot run and get information for user 23456.

e.g. $fql    =   "select  email from user where uid=23456";   <--- Fail

So, here is the problem come. I have thousands of people who previously signed up and accept the extended permission, how can I get their emails now? I cannot run this...

$fql    =   "select  email from user where uid=1000001";
$fql    =   "select  email from user where uid=1000002";
$fql    =   "select  email from user where uid=1000003";  
// assum 1000001 ... 1000003 are those users. 

I tried to login facebook using my dev account and do that, but, still it won't work. Appreciate if anyone has the solution. thanks.

解决方案

The idea is to get the user's email when he logs in, then store it in your own database for future reference.

这篇关于如何获取Facebook中的用户电子邮件地址(Facebook Connect或Graph API)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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