我想知道是否有人能够提供Parse登录的代码示例,其中必须验证电子邮件地址,并且必须来自特定地址。我相信它是这样的; [查询whereKey:@“emailVerified”equalTo:[NSNumber numberWithBool:YES]]; 和 [查询whereKey:@“comment”containsString:@“@ gmail.com”]; 但我一直无法在我的项目中得到这个工作。 任何帮助或建议将是伟大的,但一段代码将是真棒解析PFLogin电子邮件验证
下面是我现有的代码,不会让一个未经验证的电子邮件用户登录,但现在我想添加的电子邮件处理
- (void)logInViewController:(PFLogInViewController *)logInController didLogInUser:(PFUser *)user {
if (![[user objectForKey:@"emailVerified"] boolValue]){
NSLog(@"User not validated email");
[[[UIAlertView alloc] initWithTitle:@"Access restricted" message:@"To access this area please validate your email address" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil] show];
}
else if ([[user objectForKey:@"emailVerified"] boolValue]){
NSLog(@"Email validated");
[self dismissViewControllerAnimated:YES completion:NULL];
[[[UIAlertView alloc] initWithTitle:@"Welcome back" message:(@"%@", user.username) delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil] show];
}
// [self dismissViewControllerAnimated:YES completion:NULL];
NSLog(@"Login sucessfull and username is %@",user.username);
}
这帮助,如果你看看我现在已经添加的代码你可以帮助更多一些。在此先感谢 – user3611162 2015-02-05 18:46:25
您能否提供您的电子邮件要求的详细信息? – jimrice 2015-02-06 01:22:01
我只想让一个电子邮件句柄能够登录到某个区域。它包含一些我不想与更多观众分享的信息。那么电子邮件已经被验证,所以你知道他们在那里工作。该电子邮件将是[email protected]。提前感谢您的任何建议 – user3611162 2015-02-06 01:51:26