1

Parse version 1.7.1 as built by Cocoapods

I have a completely bare project where I set up an anonymous user through [PFUser enableAutomaticuser]. Judging by the _Users table in Parse, it looks like the ID's are discarded when I terminate the app, and regenerated on the subsequent app launch. At no point do I log out or do anything that should nil out the user.

Is this the intended behavior or a bug?

My code, if it matters:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{   
    // Initialize Parse.
    Parse.setApplicationId(APP_ID,
        clientKey: CLIENT_KEY)

    // Create or authenticate anonymous user
    PFUser.enableAutomaticUser()
    PFUser.currentUser()!.saveEventually { (success:Bool, error:NSError?) -> Void in
        if (success)
        {   
             // Setup push notifications
        }
    }

    // Track statistics around application opens.
    PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)

    return true
}

If it helps... Looks like the user exists at the last moment of the app's lifetime in applicationWillTerminate:, but it is nil in the next launch's applicationDidFinishLauchingWithOptions: before the call to enable the automatic user.

user
  • 3,388
  • 7
  • 33
  • 67

0 Answers0