Facebook的API - UID和电子邮件 [英] Facebook API - uids and email

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

问题描述

我想开发一个应用程序,其中


  1. 用户X已经登录到Facebook的

  2. 应用程序有一组电子邮件地址(用户可能朋友'X')

  3. 应用程序获取的用户好友列表中的X的信息(UID)

  4. 要检查是否与电子邮件地址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

  1. The user 'X' has logged into Facebook
  2. app has a set of email addresses (possible friends of user 'X')
  3. app gets the list of friends of user 'X' (uids)
  4. 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屋!

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