# Getting google play nickname and user id

**URL:** <https://forums.unrealengine.com/t/getting-google-play-nickname-and-user-id/144882>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [June 1, 2020, 2:33pm UTC](https://forums.unrealengine.com/t/getting-google-play-nickname-and-user-id/144882 "2020-06-01T14:33:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_e27ab030](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e27ab030](https://forums.unrealengine.com/u/anonymous_user_e27ab030)\
**Post date:** [June 1, 2020, 2:33pm UTC](https://forums.unrealengine.com/t/getting-google-play-nickname-and-user-id/144882/1 "2020-06-01T14:33:53Z")

</div>

Hey guys, I’m trying to get google play nickname and userID, after loggin game to google play services but I’m getting same ID with different user logged in and PlayerName is returning zero all the time. I’ve tried BP and I’ve also tried some cpp function but still with no luck:

_return PlayerController-\>PlayerState-\>UniqueId-\>GetHexEncodedString();  
return PlayerController-\>PlayerState-\>GetPlayerName();_

Controller is one from the Show external Login UI BP which is used to get player logged in:

![2020-06-01 16_29_56-BPGameInstance.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/1/d1c916f39273903e5d025a243fbb70431a4965b0.png)

Do you have any idea how to make it work? Thanks!

---

<div class="post-metadata">

**Author:** ![Alex183017](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alex183017](https://forums.unrealengine.com/u/Alex183017)\
**Post date:** [September 17, 2020, 12:15am UTC](https://forums.unrealengine.com/t/getting-google-play-nickname-and-user-id/144882/2 "2020-09-17T00:15:45Z")

</div>

I subscribe to the question.

---

<div class="post-metadata">

**Author:** ![hauk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hauk](https://forums.unrealengine.com/u/hauk)\
**Post date:** [January 27, 2022, 9:36am UTC](https://forums.unrealengine.com/t/getting-google-play-nickname-and-user-id/144882/3 "2022-01-27T09:36:10Z")

</div>

Use cpp function for the nickname.  
I’m not sure this is the right way for that.

- In your Project.Build.cs:

PrivateDependencyModuleNames.Add(“OnlineSubsystem”);

- In your cpp file:

#include “Online.h”

- In function that return FString:

auto Identity = Online::GetIdentityInterface();  
if (Identity.IsValid())  
{  
return Identity-\>GetPlayerNickname(0);  
}  
return FString();
