将Facebook图形与Firebase集成 [英] Integrate facebook graph with firebase

本文介绍了将Facebook图形与Firebase集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Firebase云功能上访问Facebook用户的原始照片大小和性别.我当时在看图API,但很难理解.据我了解,我不能仅使用Firebase来做到这一点?

I want access to facebook user's original photo size and gender on firebase cloud functions. I was looking graph api but it comes little hard to understand. I can't do that just with firebase as i understand?

有没有简单的方法可以做到这一点?

Is there any easy way to do that?

推荐答案

如果您的用户已通过Facebook身份验证,则可以从Auth Object(

If you user has authenticated by Facebook you can get the photoUrl from the Auth Object (https://firebase.google.com/docs/auth/admin/manage-users).

admin.auth().getUser(uid)
  .then(function(userRecord) {
    // See the UserRecord reference doc for the contents of userRecord.
    console.log(userRecord.photoURL);
  })
  .catch(function(error) {
    console.log("Error fetching user data:", error);
  });

如果您想连接到Facebook Graph API,则需要一个Firebase帐户,以便您可以访问Google网络之外的数据.

If you want to connect to Facebook Graph API then you'll need a pair Firebase account so you can access data outside of Googles network.

这篇关于将Facebook图形与Firebase集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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