Facebook的API - UID和电子邮件 [英] Facebook API - uids and email
本文介绍了Facebook的API - UID和电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想开发一个应用程序,其中
- 用户X已经登录到Facebook的
- 应用程序有一组电子邮件地址(用户可能朋友'X')
- 应用程序获取的用户好友列表中的X的信息(UID)
- 要检查是否与电子邮件地址some@some.com用户通过使用电子邮件地址有效的Facebook的用户和用户是X的朋友(基本上以电子邮件映射UID)
解决方案
是的,这是可能的。首先,获得的UID为所有用户的朋友。然后,执行这个FQL得到email_hashes为每个朋友:
SELECT email_hashes FROM用户WHERE UID IN(comma_delimted_set_of_uids)
既然你已经拥有的电子邮件地址,你可以散列它,并将它与Facebook的email_hash。如果你有一个比赛,你就知道它是有效的。根据该FB文档,每封电子邮件散列格式的电子邮件地址以下划线(_)相结合的CRC32和MD5哈希值。
I am trying to develop a application where
- The user 'X' has logged into Facebook
- app has a set of email addresses (possible friends of user 'X')
- app gets the list of friends of user 'X' (uids)
- Want to check if user with email address some@some.com is a valid facebook user by using email address and is user X's friend (basically a uid to email mapping)
解决方案
Yes, this is possible. First, get the UIDs for all of a user's friends. Then, execute this FQL to get the email_hashes for each friend:
SELECT email_hashes FROM user WHERE uid IN (comma_delimted_set_of_uids)
Since you already have the email address, you can hash it and compare it to facebook's email_hash. If you have a match, you know it's valid. According to the FB documentation, the format of each email hash is the crc32 and md5 hashes of the email address combined with an underscore (_).
这篇关于Facebook的API - UID和电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文