GameSparks OAuth 2.0 with android & C++

I am using Blueprints in my first game and want to get access token from google play services in my game after calling ShowExternalLoginUI, so I can connect to gamesparks.

Unfortunately, I can’t get it from blueprints. So I decided to get in C++ and try to return in by BlueprintFunctionLibrary.

FString UCToBluePrintFunctionsLibrary::getPlayerToken()
{
		
	IOnlineSubsystem* ion = IOnlineSubsystem::Get();
	IOnlineIdentityPtr OnlineIdentity = ion->GetIdentityInterface();
	if (OnlineIdentity.IsValid())
	{ 
		return OnlineIdentity->GetAuthToken(0);
	}

	return FString("None");
} 

When I tried this methoed before calling ShowExternalLoginUI, It shows “None” , and after calling it with success execution, it returns “NotAcquired”.

So I moved to another solution what may bring what I need and tried to get player Account in code because it contains getAccessToken, but because I am newbie in C++ , I didn’t know how to retrieve it.

Please if can someone help me in this situation or suggest another way to run power my game with GameSparks.

I made this code but it gives me an error:

Code:

 FString UCToBluePrintFunctionsLibrary::getUserAccount()
{
IOnlineSubsystem* ion = IOnlineSubsystem::Get();
TSharedPtr<const FUniqueNetId> pid = ion->GetIdentityInterface()->GetUniquePlayerId(0);

IOnlineIdentityPtr OnlineIdentity = ion->GetIdentityInterface();
if (pid.IsValid()) {
    TSharedPtr<const FUserOnlineAccount> userAccount = OnlineIdentity->GetUserAccount(pid);
    return userAccount.GetAccessToken();

}

return FString();
}

It says: no suitable user-defined conversion from “TSharedPtr” to “const FUniqueNetId” exists

can someone correct me plz?