0

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!

  • hmmm.. im from android... FWIW the same genl issue exist over there... be sure ios.delete will actually delete all cache/cookie tokens DATA from app is gone on delete.. AND that on re-install, that the IOS cloud is NOT going out and auto-reSYNC to the device any past ref to client-side data on the app just installed ( android has a setting "do not resync on install" ) that would prevent that situation. if nothing at all exist on client in way of cookie/token, then server-side call to "currentUser()" after cycle of deleteApp/ installApp will be null. – Robert Rowntree Oct 01 '16 at 15:29

1 Answers1

0

I have now worked out what I as doing wrong.

Its unlikely anyone will be in the same situation, but thought I'd say anyway.

Stupidly, I had the initial view controller as the 'first page' rather than the 'login page'. This meant there was no current user and hence the null user.