abcd gef
abcd gef

Reputation: 59

iOS and Parse.com Session managment

I am creating a iOS app (post management app) using Parse.com as backend. When user send post (post will be store in Post table) he/she can read using app. But problem is if user does not exist still he get post, after he create a new account in app using signup. I have created Post table to add/share post.How can i know that user only get post if he/she exist in app or login? I knew new parse api has Session table but it contains login user information. Can you give me proper solution? So only post will be available if user exist in app?

Upvotes: 1

Views: 87

Answers (1)

Diego
Diego

Reputation: 366

You can simply check if the user still exist in the database everytime he opens the app. In your AppDelegate, in the applicationDidBecomeActive method:

[[PFUser currentUser] fetchInBackgroundWithBlock:^(PFObject *object, NSError *error) {
    if (error && [error code] == kPFErrorObjectNotFound){
    [PFUser logOut];
    }
}

Upvotes: 1

Related Questions