본문 바로가기

Unity/Parse Hosting

[ Parse Hosting ] 유저 생성하기

원문

https://parse.com/apps/quickstart#social/unity/existing

코드

Add a User to Your App

  • The idea of user accounts that let people access their information and share it with others in a secure manner is at the core of any social app. Whether your app creates its own sharing environment or integrates with existing social networks, you will need to add functionality to let people manage their accounts in your app.

    We provide a specialized user class called ParseUser that automatically handles much of the functionality required for user account management.

  • To create your first user, first create a new C# script and attach it to an existing GameObject in your game. Then add the following directive:

    using Parse;
  • Next, add code to sign up a new user:

    var user = new ParseUser()
    {
        Username = "my name",
        Password = "my pass",
        Email = "email@example.com"
    };
      
    // other fields can be set just like with ParseObject
    user["phone"] = "650-555-0000";
      
    System.Threading.Tasks.Task signUpTask = user.SignUpAsync();
  • This call will asynchronously create a new user in your Parse app. Before it does this, it checks to make sure that both the username and email are unique. It also securely hashes the password in the cloud.

    You can learn more about Users, including how to verify emails and handle read and write permissions to data, by visiting our docs.

    Run your app. A new object of the class User will be sent to the Parse Cloud and saved. When you're ready, click the button below to test if a User was created.

정리

자동으로 유저명, 이메일 중복여부 체크후 중복이 안되면 성공적으로 유저를 생성해준다.

아이디, 패스워드는 암호화 된다.

user db 에는 Username, password, email 칼럼이 처음부터 생성되어있고

유저 생성시 email 은 값을 설정해주지 않아도 된다.

추가적으로 칼럼을 생성하길 원한다면 

user[칼럼명] = 데이터

처럼 생성할 수 있다.


User 에 대한 상세 설명

https://parse.com/docs/unity_guide#users



'Unity > Parse Hosting' 카테고리의 다른 글

[ Parse Hosting ] 정리 계획  (0) 2014.04.12
[ parse hosting ] 유저 데이터 저장 하기  (0) 2014.04.12