4.16 Facebook OSS not firing OnLoginFlowStarted

Hello, I had Facebook integration working in 4.15, but at 4.16 a lot changed, since Epic introduced an external UI interface for desktop implementations.

But there’s no documentation on how to confiure it properly, so I tried following this thread:

In resume, I changed the following:

  • Added LoginFlow module to my project Build.cs
  • Set OnlineFramework and OnlineSubsystemFacebook as enabled in my .uproject
  • Updated OnlineFramework.uplugin and LoginFlow.Build.cs as said by Machine.Widmo

After this configuration step, it seems we need to add some initialization code to provide the LoginFlowManager with a delegate for us to receive the slate widget. It wasn’t clear where should this code go, so as suggested by Josh.Markiewicz I added it to my Player Controller. It was also not clear in which step of the initialization process of the Player Controller we should add that, so I added it to PostInitializeComponents, so it looks like this:

void AFacebook416PlayerController::PostInitializeComponents()
{
	Super::PostInitializeComponents();

	// Initialize the login flow UI code
	UWorld* World = GetWorld();
	if (World)
	{
		FName FacebookIdentifier = Online::GetUtils()->GetOnlineIdentifier(World, FACEBOOK_SUBSYSTEM);
  
		ILoginFlowModule& LoginFlowModule = ILoginFlowModule::Get();
		LoginFlowManager = LoginFlowModule.CreateLoginFlowManager();
		if (!LoginFlowManager->AddLoginFlow(FacebookIdentifier, ILoginFlowManager::FOnDisplayPopup::CreateUObject(this, &AFacebook416PlayerController::OnDisplayLoginWidget)))
		{
			UE_LOG(LogTemp, Warning, TEXT("No Facebook subsystem configured. It will be unavailable"));
		}
	}
}

This code seems to be working fine, since AddLoginFlow is returning true. So now when I call IdentityInterface->Login I expect OnDisplayLoginWidget to be called with the login UI slate widget. The problem is that it is never called.

I head to try figuring out why was that, debugging and tracing the login from the Login implementation. This is the result:

  • OnlineSubsystemFacebook\Source\Private\Windows\OnlineIdentityFacebook

Login is implemented here. Since no ID nor token was provided, OnlineExternalUI->ShowLoginUI is called.

  • OnlineSubsystemFacebook\Source\Private\Windows\OnlineExternalUIInterfaceFacebook

ShowLoginUI called here, everything is fine so TriggerOnLoginFlowUIRequiredDelegates is called. This delegate should fire a method binded in AddLoginFlow. This is how this delegate is setup in AddLoginFlow:

OnlineExternalUI->AddOnLoginFlowUIRequiredDelegate_Handle(FOnLoginFlowUIRequiredDelegate::CreateSP(this, &FLoginFlowManager::OnLoginFlowStarted, OnlineIdentifier));

So after triggering the OnLoginFlowUIRequired delegate, we expect OnLoginFlowStarted to be called, but it never does.

I’m clueless on why OnLoginFlowStarted is not called, since we correctly called AddLoginFlow, which binded the OnLoginFlowUIRequired delegate to call it, caching our provided delegate to receive the slate widget.

Am I missing some configuration?

Hello,

We can help you. Our plugin Extended Facebook Online Subsystem is exactly what you need: Extended Facebook Online Subsystem - Marketplace - Unreal Engine Forums Plugin was released 2 years ago and was tested in many ways during this time. It’s stable, receives update every 1-2 months ,and we provide premium support.

If you have any questions, feel free to ask! :slight_smile:

Patrick,
gameDNA Ltd