I am currently developing my game in Blueprints. But I need to get a variable that I didn’t find in it but in C++.
In OnlineSubsytem using android deivces (or maybe in IOS later on) I want to get the access token so I can connect with GameSparks.com by OAuth 2.0
I wrote this code in Blueprint Function Library:
FString UCToBluePrintFunctionsLibrary::getPlayerToken()
{
IOnlineSubsystem* ion = IOnlineSubsystem::Get();
IOnlineIdentityPtr OnlineIdentity = ion->GetIdentityInterface();
if (OnlineIdentity.IsValid())
{
return OnlineIdentity->GetAuthToken(0);
}
return FString("None");
}
in my blueprints I made a login button with the blueprint ShowExternalLoginUI, It give me success in android, then I made another button to fire the event above of getPlayerToken, before I login it give me none, and after login it gives me NotAcquired. !!!
After that I noticed when writing GetAuthToken , it written @Todo - remove and use getUserAccount instead, and also have a method inside it getAccessToken.
Because I am new to C++ I can’t make the write syntax to get the access token so I can pass it to gamesparks and connect.
If anyone can help I will Appreciate it.