pronoob
pronoob

Reputation: 831

iOS user registration/authentication without signup (using Parse / Swift)

I'd like to create a user in Parse without asking the user to sign up. It is for a chat app built for iOS in Swift. I've heard that UDID is deprecated so cannot use that to uniquely identify user. I want to identify the user even if he/she reinstalls the app / changes device. I don't necessarily want to know any info on the user (email/mobile/etc), just to authenticate them and identify them with an account.

Upvotes: 1

Views: 787

Answers (1)

Hossam Ghareeb
Hossam Ghareeb

Reputation: 7113

What about using Login in Anonymously? and then after login, save the objectId of PFUser in Keychain. Before logging in check first for keychain if it has an objectId and use it to get the PFUser. Saving data in keychain will remain even if you uninstalled the app

PFAnonymousUtils.logInWithBlock {
(user: PFUser?, error: NSError?) -> Void in
 if error != nil || user == nil {
  println("Anonymous login failed.")
 } else {
   println("Anonymous user logged in.")
 }
}

Upvotes: 2

Related Questions