I am currently using Parse in my app to manage users.
One problem I am having is switching between the test and live version of my app.
The usual flow of my app is as follows:
- The user opens the app and the login page is shown
- If that user is currently logged in (PFUSer.current().objectId != nil), then the app does a segue to my 'first page'.
- If not the user logs in as usual
The problem I am having is when I am currently logged in on the test version and then download the live version. The app detects a current user and does the segue to the 'first page'.
However, it does not return the usual user (which has a lot more parameters associated with it including name, email etc), it returns this instead:
Optional(<\PFUser: 0x16db4160, objectId: new, localId: (null)>
This then causes a crash, given my assumption that anyone on the 'first page' must have an objectId.
My main worries / questions are:
A. Can someone please explain to me why / how this is happening? B. Could this also be triggered upon deletion / reinstallation of a live version of the app? C. How are app updates managed with current user? ie Could this also be a problem?
Thanks in advance!