Osiris
Osiris

Reputation: 129

Parse Server how to get AuthenticationCallback after logInWithInBackground?

how it possible to get callback after calling logInWithInBackground? currently I'm using below code for login but don't know how to get it success result.

Task<ParseUser> parseUserTask = ParseUser.logInWithInBackground("facebookaccountkit", authData);

I want to send user to another activity after successful login.

api links:

https://parseplatform.org/Parse-SDK-Android/api/com/parse/ParseUser.html#logInWithInBackground-java.lang.String-java.util.Map-

https://parseplatform.org/Parse-SDK-Android/api/com/parse/AuthenticationCallback.html

Upvotes: 0

Views: 335

Answers (1)

You can use a continuation:

parseUserTask.continueWith(new Continuation<ParseUser, Void>() {
            @Override
            public Void then(bolts.Task<ParseUser> task) {

                if(task.isCancelled()){
                    showError();
                    return null;
                }
                if (task.isFaulted()){
                    showError();
                    return null;
                }

                final ParseUser user = task.getResult();
                //do something with the user
                return null;
            }
        });

this is taken from Google OAuth Configuration

Upvotes: 1

Related Questions