Parse.com PFUser链接twitter和Facebook帐户? [英] Parse.com PFUser Linking twitter and facebook account?

查看:112
本文介绍了Parse.com PFUser链接twitter和Facebook帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 parse.com 作为我的应用程序的后端,它使用户可以通过他的Facebook或Twitter帐户登录。此外,它还具有将twitter / Facebook连接到其先前存在的帐户的功能。

I am using parse.com as backend of my application, it enables the user to login through his facebook or twitter account. Also it has the feature to link twitter/facebook to his pre-existing account.

以下是问题:

如果用户登录他的 code>帐户一个新的 PFUser 是在云上创建的。
如果同一用户通过他的 twitter 帐户再次登录,则在云上创建另一个 PFUser
现在,如果用户想将他的 facebook 帐户与他的 twitter 帐户关联起来, parse.com 回复这个twitter帐户已经连接到另一个用户。

If a user logins through his facebook account a new PFUser is created on the cloud. If the same user again logins through his twitter account another PFUser is created on the cloud. Now if the user wants to link his facebook account with his twitter account, parse.com replies with "this twitter account is already connected to another user."

如何在两个 PFUsers 中合并?有人可以建议我解决这个问题吗?

How can I merge two PFUsers here? Can anybody please suggest me an approach to solve this issue?

推荐答案

遗憾的是,似乎不可能有一个Facebook或Twitter帐户链接到多个PFUser。此外,似乎无法合并两个更多PFUser条目 - 请参阅此处的解析答案

Regretfully, it seems that it is not possible to have a Facebook or Twitter account linked to more than one PFUser. Additionally, it seems that it s not possible to merge two more more PFUser entries - See Parse's answer here.

您可能想要做的是将PFUser表中的数据严格保留以进行授权,并将其余数据保留在新的专用Parse类中(说用户数据,由PFUser条目指向)。

What you might want to do instead is keep the data on the PFUser table strictly for authorization purposes and keep the rest of the data in a new and dedicated Parse class (say userData, pointed to by PFUser entries).

在这个意义上,您将能够使用指向相同userData条目的多个PFUser条目。因此,如果您在Parse后端中具有与特定Twitter帐户相关联的先前存在的PFUser条目,则最好将用户登录到该特定PFUser,然后将该条目指向您之前存在的userData条目。

In that sense, you'll be able to use multiple PFUser entries pointing to the same userData entry. Thus if you have a previously existing PFUser entry linked to a specific Twitter account in the Parse backend, it's best that you make the user login to that specific PFUser, and then point that entry to your previously existing userData entry.

这篇关于Parse.com PFUser链接twitter和Facebook帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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