Parse Server how to get AuthenticationCallback after logInWithInBackground?

336 views Asked by At

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

1

There are 1 answers

0
Jesus Manuel Garnica Bonome On

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