带Back和社交登录的Ionic:剖面图

8fsztsew  于 2022-12-09  发布在  Ionic
关注(0)|答案(1)|浏览(104)

我正在使用ionic和Backand开发一个应用程序,我正在使用Backand服务的社交帐户登录。但是我想从Facebook和Google Plus获得ID,以便获得个人资料图片。我在Backand的支持下进行了交谈,我知道在安全和Auth中有一个动作“beforesocialSignUp”并且我没有注解该行以获取数据:

'use strict';
function backandCallback(userInput, dbRow, parameters, userProfile) {
   // get facebook id and put in fuid field that you need to add to your user object
   userInput.fuid = parameters.socialProfile.additionalValues.id;
   // get gender from facebook and put in gender field that you need to add to your user object
   // userInput.gender = parameters.socialProfile.additionalValues.gender;
}

我已经在我的用户对象中创建了fuid字段,但是,当我用Facebook或Google+登录时,它什么也不保存。登录是可以的,但是我不能得到ID数据。
你知道吗?

rjee0c15

rjee0c151#

我也有同样的问题。
解决方案是将BeforeSocialSignUp函数的where条件从false设置为true。
这在说明文档中没有任何地方。
我花了3天的时间才弄明白
现在,登录按预期工作,并分配了fuid字段。
我的下一步是从FB帐户获得个人资料图片,但因此我必须向Facebook发出API请求,并使用一个用户访问令牌,我不知道如何从Backand获得该令牌。

相关问题