Ios 解析在哪里存储用户会话
登录代码:Ios 解析在哪里存储用户会话,ios,objective-c,parse-platform,Ios,Objective C,Parse Platform,登录代码: [PFUser logInWithUsernameInBackground:self.userTextField.text password:self.passwordTextField.text block:^(PFUser *user, NSError *error) { if (user) { [self performSegueWithIdentifier:@"LoginSuccesful" sender:self]; } else {
[PFUser logInWithUsernameInBackground:self.userTextField.text password:self.passwordTextField.text block:^(PFUser *user, NSError *error) {
if (user) {
[self performSegueWithIdentifier:@"LoginSuccesful" sender:self];
}
else {
NSInteger code = [error code];
NSString *message;
if (code == 100) {
message = @"No Internet Connection";
}
else if(code == 101) {
message = @"Wrong credentials";
}
UIAlertView *errorAlertView = [[UIAlertView alloc] initWithTitle:@"Error" message:message delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[errorAlertView show];
}
}];
我们可以检查用户是否已登录
if ([PFUser currentUser]) {
// user is logged
}
这意味着PFUser logInWithUsernameInBackground:password:下载用户数据并将其存储在iOS中的某个位置,我不知道它是在plist还是其他文件中,或者可能是会话中
Parse Framework在iOS中将用户登录会话存储在哪里?我对我的一个使用Parse的应用程序进行了一番探索,发现了以下内容
在
Library/Private Documents/Parse
中有一个currentUser
文件,其中包含用户的JSON表示。您是否创建了访问这些数据的方法?我对会话id特别感兴趣。我正在从解析服务器转移到自己的实现中,不希望我的用户再次登录。我认为这样做的方法是直接访问会话id并使用它进行身份验证。