bdv
bdv

Reputation: 1204

Data retrieved from app shows different data than parse data browser

I'm keeping track of where the user is in the onboarding process. In the case they close the app while onboarding, this won't get messed up.

I'm keeping track with the database row authstatus. This can have 4 values ranging from 0 to 3 The cloud code updates the authstatus to 0, 2 and 3 and in the app I'm updating it to 1 on a specific point in the onboarding.

When retrieving the onboarding status however, by this code:

NSNumber *authStatus = currentUser[@"authstatus"];
NSLog(@"authstatus:%@", authStatus);

I'm always getting 1, also when the authstatus in the parse databrowser says something different. How do I fix this and how come?

Upvotes: 2

Views: 83

Answers (1)

allieluu
allieluu

Reputation: 78

If currentUser is referencing [PFUser currentUser], that user and its information is stored in local storage in a cache. In order to get the updated data from the data browser you have to call [PFUser currentUser] refresh] before referencing currentUser[@"authstatus"].

Upvotes: 2

Related Questions