/// <summary> /// Gets the user's email. /// </summary> /// <remarks>The email address returned is selected by the user from the accounts present /// on the device. There is no guarantee this uniquely identifies the player. /// For unique identification use the id property of the local player. /// The user can also choose to not select any email address, meaning it is not /// available.</remarks> /// <returns>The user email or null if not authenticated or the permission is /// not available.</returns> public string GetUserEmail() { if (!this.IsAuthenticated()) { Debug.Log("Cannot get API client - not authenticated"); return(null); } mTokenClient.SetRationale(rationale); return(mTokenClient.GetEmail()); }
protected override void OnAppearing() { BindingContext = new SettingsViewModel { EmailAddress = _tokenClient.GetEmail(), LastLogin = _tokenClient.GetLogin().ToLongDateString(), LoginExpiresAt = _tokenClient.GetExpiry().ToLongDateString() }; }
public string GetUserEmail() { if (!IsAuthenticated()) { Debug.Log((object)"Cannot get API client - not authenticated"); return(null); } return(mTokenClient.GetEmail()); }
/// <summary>Gets the user email.</summary> /// <returns>The user email or null if not authenticated or the permission is /// not available.</returns> public string GetUserEmail() { if (!this.IsAuthenticated()) { Debug.Log("Cannot get API client - not authenticated"); return(null); } if (!GameInfo.WebClientIdInitialized()) { //don't spam the log, only do this every so often if (noWebClientIdWarningCount++ % webclientWarningFreq == 0) { Debug.LogError("Web client ID has not been set, cannot request email."); // avoid int overflow noWebClientIdWarningCount = (noWebClientIdWarningCount / webclientWarningFreq) + 1; } return(null); } mTokenClient.SetRationale(rationale); return(mTokenClient.GetEmail()); }
/// <summary>Gets the user email.</summary> /// <returns>The user email or null if not authenticated or the permission is /// not available.</returns> public string GetUserEmail() { if (!this.IsAuthenticated()) { Debug.Log("Cannot get API client - not authenticated"); return(null); } if (!GameInfo.RequireGooglePlus()) { //don't spam the log, only do this every so often if (needGPlusWarningCount++ % needGPlusWarningFreq == 0) { Debug.LogError("RequiresGooglePlus not set, cannot request email."); // avoid int overflow needGPlusWarningCount = (needGPlusWarningCount / needGPlusWarningFreq) + 1; } return(null); } mTokenClient.SetRationale(rationale); return(mTokenClient.GetEmail()); }