question

viridesoft avatar image
viridesoft asked

How to get Google mail of AccountInfo

I have 2 problems:

First with Google:

I get an empty response all time when I use "result.AccountInfo.GoogleInfo.GoogleEmail". I connect without problems and see all other data but can't access to the GoogleEmail of the account, I'm forced to get it with "PlayGamesPlatform.Instance.GetUserDisplayName()"

Second with Facebook:

In my Dashboard, I cant see the Facebook id when I link only see "---". In the code is all ok with Facebook.

Account Management
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

For Google, the email address is only part of that data if it was provided as part of the Google login (depends upon the player's permissions settings in Google). You can add a player email address at any time using AddOrUpdateContactEmail. Based on the event history, that appears to be how your player account had the email address added (https://developer.playfab.com/en-us/6ADE/players/3687954E39833F1D/event-history). In that case, you can query it via the profile data (GetPlayerProfile).

For Facebook, that's correct, and it's in order to comply with Facebook's policies. It's important to note that the ID wouldn't do you any good, anyway. Facebook returns a unique ID for a player on every single application - and none of those will be your actual Facebook ID (the one you get from your account in Facebook itself). We use their business lookup logic to associate the app IDs we get for users with each other, so that we can know when a player in one of your games signs into another of your games using Facebook (the account login is shared between games via your Publisher ID).

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

viridesoft avatar image viridesoft commented ·

Ok, I Understand the Facebook work but with Google...

It is not efficient to make two calls to the api to get the mail on one hand and on the other hand the name, the id, and the facebook name. To get the Google permissions of email must be configured in Unity, Google or Playfab?

0 Likes 0 ·
brendan avatar image brendan viridesoft commented ·

You can get all the information about the player (name, ID, Facebook name) in one call, using https://api.playfab.com/documentation/client/method/GetAccountInfo or https://api.playfab.com/documentation/client/method/GetPlayerCombinedInfo.

For the permissions, you choose which permissions you want your title to require in your game's manifest.

0 Likes 0 ·
viridesoft avatar image viridesoft brendan commented ·

I find the problem, you should complete the documentation for this.

For get the google email I need add this:

old code:

PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().AddOauthScope("profile").RequestServerAuthCode(false).Build();

new code

PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().AddOauthScope("profile").RequestServerAuthCode(false).RequestEmail().Build();

The problem with the email resides in add RequestEmail() to the builder.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.