C# function continues without waiting for called Google Play method to complete

Okay maybe I’m just missing something blatantly obvious here and sorry if that’s the case, but I’m stumped. I’m trying to adjust my Google Play Services log-in and cloud save system to have a little more flexibility. This is my code (I’ll only provide the relevant sections):

void Start () {
		ActivateSocialPlatform ();
		LoginSuccess = false;
		Login ();
}

private void Login(){
	DebugText.text += "Starting login process 

";
GooglePlaySignIn ();
if (LoginSuccess == true) {
LoadData();
} else {
DebugText.text += "Something went wrong
";
}
}

public void GooglePlaySignIn(){
	DebugText.text += "Signing into Google Play 

";
Social.localUser.Authenticate ((bool success) => {
if (success) {
DebugText.text += "Google Play authentification success
";
LoginSuccess = true;
} else {
DebugText.text += "Google Play authentification failed
";
LoginSuccess = false;
}
});
}

Basically, I call Login() to start the authentification process in GooglePlaySignIn(), which is supposed to set the variable LoginSuccess either true or false, and if it’s true, I start loading savedata from the cloud. However I end up with a log like this:

Activating Social Platform
Starting login process
Signing into Google Play
Something went wrong
Google Play authentification success

As I understand, for some reason the function Login() doesn’t wait until GooglePlaySignIn() completes and continues into the false state, AFTER which the user is actually signed on. Why does this happen? I thought all functions are supposed to wait until their called functions complete before continuing with their own code? Everything works just fine if I place the authentification code inside Login() itself, instead of having it in a separate function. I want to be able to reuse this code though, instead of having to duplicate it every time I need the user to log in again.

Thanks in advance.

Login is just a method that does not know how to wait. it executes it’s block in one go. the only part that is waiting here is Authenticate(). internally that’s an asynchronous call, going all the way through the internet and when returning executes the lambda expression you passed in as a parameter. If you want log-in to wait make it a coroutine and yield for a success. or put LoadData into the Lambda callback where it checks for success. OR create your own callback that you pass to GooglePlaySignIn which you call on success.