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

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

问题描述

我正在尝试开发一个应用程序,其中

I am trying to develop a application where

  1. 用户X"已登录 Facebook
  2. 应用有一组电子邮件地址(可能是用户X"的朋友)
  3. app 获取用户X"的好友列表(uid)
  4. 想通过使用电子邮件地址检查电子邮件地址为 some@some.com 的用户是否是有效的 Facebook 用户,并且是用户 X 的朋友(基本上是电子邮件映射的 uid)

推荐答案

是的,这是可能的.首先,获取用户所有朋友的 UID.然后,执行此 FQL 以获取每个朋友的 email_hashes:

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)

由于您已经拥有电子邮件地址,您可以对其进行哈希处理并将其与 Facebook 的 email_hash 进行比较.如果你有一个匹配,你就知道它是有效的.根据 FB 文档,每个电子邮件哈希的格式是电子邮件地址的 crc32 和 md5 哈希加上下划线 (_).

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天全站免登陆