解析在哪里存储用户会话 [英] Where does Parse store user session
问题描述
登录代码:
[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];
}
}];
我们可以检查用户是否已登录
We can check whether user is logged or not with
if ([PFUser currentUser]) {
// user is logged
}
这意味着PFUser logInWithUsernameInBackground:password:下载用户数据并将其存储在iOS中的某个位置,我不知道它是在plist中还是在另一个文件中,或者可能是会话中.
It means PFUser logInWithUsernameInBackground:password: download the user data and store it somewhere in iOS, I don't know whether it is in plist or another file, or maybe session.
Parse Framework在iOS的哪里存储用户登录会话?
Where does Parse Framework store user login session in iOS?
推荐答案
我在一个使用Parse的我的应用程序上戳了一下,发现了以下内容.
I had a bit of a poke around an app of mine that uses Parse and found the following.
在Library/Private Documents/Parse
内部,有一个currentUser
文件,其中包含用户的JSON表示形式.
Inside Library/Private Documents/Parse
there is a currentUser
file, and this contains the JSON representation of your user.
这篇关于解析在哪里存储用户会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!