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.