Skip to content

ParseUser.getCurrentUser() is null after app update #492

@jjalan

Description

@jjalan

If the user has installed the app and logged in with Facebook (done using Parse Android SDK UI Library), everything is working great. Now, when we publish a new version of the app and the user updates the app, ParseUser.getCurrentUser() is returning null.

I am initializing Parse in Application.java as follows:

Parse.enableLocalDatastore(this); Parse.initialize(new Parse.Configuration.Builder(this) .applicationId(getString(R.string.parse_app_id)) .clientKey(getString(R.string.parse_client_key)) .server(getString(R.string.parse_server_url)) .build() );

On my MainActivity (launcher Activity), I do the following:

if (ParseUser.getCurrentUser() == null) { Intent intent = new Intent(this, LoginActivity.class); ParseLoginConfig config = new ParseLoginConfig(); config.setFacebookLoginEnabled(true); intent.putExtras(config.toBundle()); startActivityForResult(intent, LOGIN_REQUEST); }

Here, LoginActivity derives from ParseLoginActivity. This is the only place we show login screen. This implies that on every update, somehow ParseUser.getCurrentUser() is getting null.

Is this expected? I do not want to force the user to re-login everytime they update the app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions