AddFriendAsync (with ID) returns wrong user (Authenticatian via Google Play Games)

TL;DR: I added a known User via ID, but Unity Friends returned a wrong profile.

On my Debugging Device and in Production (Android Phone) I use Google Play Games to Authenticate Users. In the editor for debugging purpose I use Anonymous log-in. → Both Works
In the editor I added my Device as a new friend using the ids from AuthenticationService.Instance.PlayerId;
But the returned friend is the wrong one, telling by the name.
Does mixing of IDs (Google Play Games ↔ Unity Anonymous Log-In) result in MixUps?
What’s the best practice for mixing Authentication-Services?

EDIT: The profiles actually seem to match (online, offline etc.). But the names are just random and have nothing to do with the actual ones. Something like “InfiniteCryingMule#8” and so on. Where is that coming from?
Cheers.

Figured it out. For those having the same “problem”:

  1. AuthenticationService.Instance.SignInAnonymouslyAsync() will return a random name when calling AuthenticationService.Instance.PlayerName()
  2. If you are actually using Anonymous Log In you can change that name using AuthenticationService.Instance.UpdatePlayerNameAsync()
  3. If you are using Google Play Games, the correct name can be retrieved using PlayGamesPlatform.Instance.GetUserDisplayName()

Cheers

1 Like