question

giorgiotino avatar image
giorgiotino asked

G+ account userId format and Google Play Games userId format problem

Just recently I have found out that when I link an account with Google Play Games, latest version for Unity, the userId that is returned by PlayFab in the UserAccountInfo.GoogleInfo.GoogleId (in the login response) is not the same as the userId I retrieve via PlayGamesPlatform.Instance.GetUserId();

More specifically, UserAccountInfo.GoogleInfo.GoogleId seems to be in old G+ format, while PlayGamesPlatform.Instance.GetUserId() seems to be in new GPG format (begins with a 'g').

How can I check if the current GPG user is the same one as the one whose account has been linked on PlayFab?

This is very important as otherwise I cannot detect if a player is trying to link a google account that maybe is different than the one that has already been linked.

I was looking at the following thread but it is pretty old and I don't know if it still applies:

https://community.playfab.com/questions/11022/google-player-id-problem-and-possible-getplayfabid.html

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

·
Citrus Yan avatar image
Citrus Yan answered

I believe it’s still the case as mentioned in this thread:

https://community.playfab.com/questions/11022/google-player-id-problem-and-possible-getplayfabid.html

Since Google provides no mapping of the Google account ID and the GPG user ID, and their secure account authentication returns the Google account ID, not the GPG user ID. Therefore, you’d need to retrieve the user’s Google account ID for the lookup with PlayFab.

1 comment
10 |1200

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

giorgiotino avatar image giorgiotino commented ·

So basically Unity GPG plugin is unusable with PlayFab, as it returns the correct token to link the identity, but then the linked identity id will never match the current signed-in user id returned by the GPG SDK? Shall I use another way to get and set the linking identity token so that the user ids will match? Is there an official suggested way to accomplish this task?

I am looking into sign-in with Firebase as it seems to use G+ user ids and credentials, but I wonder if this is the way to go from PlayFab point of view?

0 Likes 0 ·

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.