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

查看:24
本文介绍了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.

问题来了:

如果用户通过他的 facebook 帐户登录,则会在云上创建一个新的 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 条目 - 请参阅 Parse 的答案在这里.

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 类中(比如 userData,由 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 条目.因此,如果您有一个先前存在的 PFUser 条目链接到 Parse 后端中的特定 Twitter 帐户,最好让用户登录到该特定 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天全站免登陆