I tried in Dev mode everything working well so i can login account and i can get online notification so i can show overlay. But when i push to stage and download stage version doesn’t work well. I launch the game on Epic Launcher I can login account but i can’t be online and can’t get online notification so i can’t show overlay.
My login EOS codes in player controller
include “EosPC.h”
include “OnlineSubsystem.h”
include “OnlineSubsystemUtils.h”
include “OnlineSubsystemTypes.h”
include “Interfaces/OnlineIdentityInterface.h”
void AEosPC::BeginPlay()
{
Super::BeginPlay();
Login();
}
void AEosPC::Login()
{
ErMes = “Login called”;
ErrorMes();
IOnlineSubsystem* Subsystem = Online::GetSubsystem(GetWorld());
IOnlineIdentityPtr Identity = Subsystem->GetIdentityInterface();
FUniqueNetIdPtr NetId = Identity->GetUniquePlayerId(0);
ErMes = “CheckNetId”;
ErrorMes();
ErMes = “Set LoginDelegateHandle”;
ErrorMes();
LoginDelegateHandle = Identity->AddOnLoginCompleteDelegate_Handle(0, FOnLoginCompleteDelegate::CreateUObject(this, &ThisClass::HandleLoginCompleted));
FString AuthType;
FParse::Value(FCommandLine::Get(), TEXT(“AUTH_TYPE=”), AuthType);
FString AuthPassword;
FParse::Value(FCommandLine::Get(), TEXT(“AUTH_PASSWORD=”), AuthPassword);
ErMes = “AUTH_TYPE=”;
ErMes.Append(AuthType);
ErrorMes();
ErMes = “AUTH_Password=”;
ErMes.Append(AuthPassword);
ErrorMes();
if (!AuthType.IsEmpty())
{
UE_LOG(LogTemp, Log, TEXT(“Logging into EOS…”));
ErMes = “Auto logging into EOS…”;
ErrorMes();
if (!Identity->AutoLogin(0))
{
UE_LOG(LogTemp, Warning, TEXT("Failed to login… "));
ErMes = "Failed to Auto login… ";
ErrorMes();
Identity->ClearOnLoginCompleteDelegate_Handle(0, LoginDelegateHandle);
LoginDelegateHandle.Reset();
}
}
else
{
ErMes = “Trying AUTH_TYPE=ExchangeCode”;
ErrorMes();
FOnlineAccountCredentials Credentials(“ExchangeCode”,“”, AuthPassword);
UE_LOG(LogTemp, Log, TEXT(“Logging into EOS…”));
ErMes = "Logging into EOS… Password: ";
ErMes.Append(AuthPassword);
ErMes.Append("AuthType: ");
ErMes.Append(AuthType);
ErrorMes();
if (!Identity->Login(0, Credentials))
{
UE_LOG(LogTemp, Warning, TEXT("Failed to login… "));
ErMes = "Failed to login… ";
ErrorMes();
Identity->ClearOnLoginCompleteDelegate_Handle(0, LoginDelegateHandle);
LoginDelegateHandle.Reset();
}
}
}
void AEosPC::HandleLoginCompleted(int32 LocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, const FString& Error)
{
IOnlineSubsystem* Subsystem = Online::GetSubsystem(GetWorld());
IOnlineIdentityPtr Identity = Subsystem->GetIdentityInterface();
if (bWasSuccessful)
{
UE_LOG(LogTemp, Log, TEXT(“Login callback completed!”));;
ErMes = "Login callback completed! - ";
ErMes.Append(Error);
ErrorMes();
OpenGame();
}
else
{
UE_LOG(LogTemp, Warning, TEXT(“EOS login failed.”));
ErMes = "EOS login failed. - ";
ErMes.Append(Error);
ErrorMes();
}
Identity->ClearOnLoginCompleteDelegate_Handle(LocalUserNum, LoginDelegateHandle);
LoginDelegateHandle.Reset();
}
I am using this method right now and i can login account in stage version but i cant get online notification so i cant open overlay.
For this codes i looked this " Plugin Configuration - The EOS Online Subsystem (OSS) Plugin | Epic Developer Community ". And yes i want to login with exchangecode.
