2013-05-13 2 views
1

안녕하세요, 저는 Parse가 제공하는 사용자 계정이 필요한 프로젝트에 Parse API의 데이터베이스를 사용하려고합니다. 내가 https://parse.com/docs/android_guide#users에서 사용자 계정을 설정하는 방법에 대한 자습서를 읽는 동안은 말했다 :emailVerification = false in parse

응용 프로그램의 설정에서 메일 인증을 사용

는 "응용 프로그램이 확약 된 이메일 주소와 사용자 경험의 일부를 예약 할 수 있습니다 이메일 확인이 추가됩니다. ParseUser 객체에 대한 emailVerified 키 ParseUser의 전자 메일이 설정되거나 수정되면 emailVerified는 false로 설정되고 사용자는 emailVerified를 true로 설정하는 링크를 전자 메일로 보냅니다. "

가 정확히 어떻게 당신이 emailVerification 키를 추가 = 사용자가 시도 사실 때마다 등록 :

ParseUser user = new ParseUser(); 
user.setUsername(username); 
user.setPassword(password); 
user.setEmail(email); 

user.signUpInBackground(new SignUpCallback() { 
    public void done(ParseException e) { 
     if (e == null) { 
      // sign up succeeded so go to multiplayer screen 
      // store the username of the current player 
      currentUser = username; 
      final String title = "Account Created Successfully!"; 
      final String message = "Please verify your email before playing"; 
      buildAlertDialog(title, message, true); 
     } else { 
      // sign up didnt succed. //TODO: figure out how do deal with error 
      final String title = "Error Account Creation failed"; 
      final String message = "Account could not be created"; 
      buildAlertDialog(title, message, false); 
     } 
    } 
}); 
+0

코드에서 emailVerified를 false로 설정하지 않았습니다. 지금 비어 있습니다. – James

답변

4

이동하여 parse.com 대시 보드, 설정, 이메일 설정으로 이동하여 확인 사용자의 이메일을 전환합니다.

enter image description here

필요가 없습니다 코드입니다.

+0

응답 해 주셔서 감사합니다! 그것은 작동합니다! 이 필드에 액세스하는 방법을 알고 있는지 궁금합니다. 나는 if (emailVerified)와 같은 것을하고 싶다 – James

+3

나는 그것이 boolean과 같을 것이라고 안드로이드 API를 사용한다고 생각한다. emailVerified = user.getBoolean ("emailVerified"); – Arcayne