Hello everyone.
I’m using Google sign In plugin to authenticate users:
It works well so far:
public void SignIn() {
GoogleSignIn.Configuration = configuration;
GoogleSignIn.Configuration.UseGameSignIn = false;
GoogleSignIn.Configuration.RequestIdToken = true;
AddStatusText("Calling SignIn");
GoogleSignIn.DefaultInstance.SignIn().ContinueWith(OnAuthenticationFinished);
}
public async void SignOut() {
AddStatusText("Calling SignOut");
var signInUser = await GoogleSignIn.DefaultInstance.SignIn();
GoogleSignIn.DefaultInstance.SignOut();
}
private void OnAuthenticationFinished(Task<GoogleSignInUser> task) {
if (task.IsFaulted) {
using (IEnumerator<Exception> enumerator =
task.Exception.InnerExceptions.GetEnumerator()) {
if (enumerator.MoveNext()) {
GoogleSignIn.SignInException error =
(GoogleSignIn.SignInException)enumerator.Current;
//AddStatusText("Got Error: " + error.Status + " " + error.Message);
AddStatusText("error: "+error.Message);
} else {
AddStatusText("Got Unexpected Exception?!?" + task.Exception);
}
}
} else if (task.IsCanceled) {
AddStatusText("Canceled");
} else {
//got authed user
var user = task.Result;// no birth date here :(
AddStatusText("Welcome: " + user.DisplayName);
OnSignIn?.Invoke(user);
}
}
The problem is I need to receive a birth date if it was set.
Unfortunatelly plugin returns only basic user info(display name,user id, email, etc.)
Is there api to get additional user data like birth date?