[英]Register a user via Facebook login (no username/password specified)
The Parse documentation provides instructions on associating a Facebook account with a registered ParseUser. 解析文档提供了有关将Facebook帐户与注册的ParseUser关联的说明。
To register a ParseUser, the user needs to pick a username, password and provide an email. 要注册ParseUser,用户需要选择用户名,密码并提供电子邮件。
I am creating a mobile game where I will be using Parse to store data about game sessions and I will be using Facebook to allow users to "Challenge" their Facebook friends to initiate these challenges. 我正在创建一个手机游戏,我将使用Parse来存储有关游戏会话的数据,并且将使用Facebook允许用户“挑战”他们的Facebook朋友来发起这些挑战。
For this reason, I would like to let my users "register" by logging in to my game with their Facebook account. 因此,我想让我的用户通过使用其Facebook帐户登录我的游戏来“注册”。 I do not need them to pick a username and password. 我不需要他们选择用户名和密码。
How can I achieve this? 我该如何实现?
You can create a Parse user after you logged in via Facebook and there will be no need to provide any username, password or email. 通过Facebook登录后,您可以创建一个Parse用户,而无需提供任何用户名,密码或电子邮件。 Use the Facebook Unity SDK to log in your user first as shown here: https://developers.facebook.com/docs/unity/examples#login 使用Facebook Unity SDK首先登录您的用户,如下所示: https : //developers.facebook.com/docs/unity/examples#login
Then create a Parse user associated with that Facebook user using the Parse ParseFacebookUtils by calling LogInAsync()
method: 然后通过调用LogInAsync()
方法,使用Parse ParseFacebookUtils创建与该Facebook用户关联的Parse用户:
Task<ParseUser> logInTask = ParseFacebookUtils.LogInAsync(userId, accessToken, tokenExpiration);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.