How to configure OnlineSubsystem LoginFlow

Thanks Jon! I really appreciate it.

Error (active) E0135 namespace “Online” has no member “GetUtils” Comp f:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 65

Error C2039 ‘GetUtils’: is not a member of ‘Online’ Comp F:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 65

Error C3861 ‘GetUtils’: identifier not found Comp F:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 65

To clarify, this is coming from the code that Josh posted above.

The code Josh posted above is sample code. I’m not sure if he created it, or pulled it out of a game, but he likely didn’t intend for you to directly copy and paste it.

Further, if it was grabbed from one of our games there’s always the possibility it wouldn’t work directly, as game’s may make modifications to engine code.

TL;DR you should have treated that as example or pseudo code to get an idea of how a flow looked.

The problem you’re running into is that your MyPlayerController.cpp class isn’t including the appropriate headers. These weren’t included in the sample code above, because again it was sample code.

Try adding the `#include “OnlineSubsystemUtils.h” to your MyPlayerController.cpp class.

I wouldn’t be surprised if there are other headers you’ll need to find / include, but that should get you passed the current issue.

Thanks,
Jon N.

Thanks Jon.

I’m sorry to be difficult, but all of this stuff was working in 4.15. I upgraded my engine, and now it’s all broken. I’m doing my best to try to stay positive and assist you guys as much as I can to identify the issues and get them fixed.

I understand that Josh’s code was meant as a sample. I understand that there are no examples, and no documentation - which makes this process difficult. I’m doing my best to make it work.

I will take the time to write up a blog post with working code, to illustrate how this is actually done - once I can get it working.

Including OnlineSubsystemUtils.h FIXED ‘GetUtils’: is not a member of ‘Online’. Awesome. Thank you.

Next issue is another include that I can’t figure out:

Error (active) E0020 identifier “ILoginFlowModule” is undefined Comp f:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 71

Error (active) E0020 identifier “LoginFlowManager” is undefined Comp f:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 72

I’ve tried including “LoginFlow”, “OnlineFramework”
I’ve tried putting them in the build.cs PublicDependencyModuleNames

Error Couldn’t find module rules file for module ‘OnlineFramework’. Comp F:\Unreal Projects\Comp\Intermediate\ProjectFiles\EXEC 1

Again, a working sample would be ideal, but we can go error by error until we get it working.

Error (active) E0020 identifier “ILoginFlowModule” is undefined Comp f:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 71

Add this #include "ILoginFlowModule.h"
Technically, that should solve the following one too, but it never hurts to be explicit.

Error (active) E0020 identifier “LoginFlowManager” is undefined Comp f:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 72

#include "ILoginFlowManager.h"

Just an FYI. All of the publicly available header files for LoginFlow can be found at Engine\Plugins\Online\OnlineFramework\Source\LoginFlow\Public.

If you run into anymore of these types of errors, you’ll just need to include the corresponding header file that has the given type defined.

For your own header files, I’d recommend using forward declarations.

Error Couldn’t find module rules file for module ‘OnlineFramework’. Comp F:\Unreal Projects\Comp\Intermediate\ProjectFiles\EXEC 1

OnlineFramework is not a module, it’s a plugin. It’s not going to have a module description.

Therefore, in your *.uplugin file you’ll need to set it is an enabled plugin (we covered this in one of the previous comments).

Do not attempt to include it in your Build.cs files.

LoginFlow is a module, not a plugin. It’s not going to have a plugin description.

Therefore, do not include it in your *.uplugin file.

Do put it in your Build.cs with the PublicDependencies.

Thanks,
Jon N.

Ok, after a lot of trial and error, I was able to get a bit further into the example code. Something I did also fixed the includes for ILoginFlowModule and ILoginFlowManager. Not exactly sure what it was.

I followed some other threads about how to get slate included. Which I think is required for FReply?

One line at a time, I suppose. Next up is this line:

if (!LoginFlowManager->AddLoginFlow(FacebookIdentifier, ILoginFlowManager::FOnDisplayPopup::CreateUObject(this, &AMyPlayerController::OnDisplayLoginWidget)))

Which errors out with:
Error (active) E0304 no instance of overloaded function “TBaseDelegate<WrappedRetValType, ParamTypes…>::CreateUObject [with WrappedRetValType=ILoginFlowManager::FOnPopupDismissed, ParamTypes=<const TSharedRef<SWidget, ESPMode::NotThreadSafe> &>]” matches the argument list Comp f:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 77

I created the OnDisplayLoginWidget like Josh’s example:

void AMyPlayerController::OnDisplayLoginWidget(const TSharedRef& DisplayWidget)

I created the OnDisplayLoginWidget like Josh’s example:

void AMyPlayerController::OnDisplayLoginWidget(const TSharedRef& DisplayWidget)

ILoginFlowManager::FOnDisplayPopup::CreateUObject(this, &AMyPlayerController::OnDisplayLoginWidget)

That code will try to create a new ILoginFlowManager::FOnDisplayPopup delegate, and assign it to the AMyPlayerController::ONDisplayLoginWidget, for the instance this.

The problem here is that the signature is wrong so it can’t. This is wrong in the sample code provided as well.

If you take a look, ILoginFLowManager::FOnDisplayPopup is declared as following:

DECLARE_DELEGATE_RetVal_OneParam(FOnPopupDismissed, FOnDisplayPopup, const TSharedRef& /*LoginWidget*/);

So, it needs to return an ILoginFlowManager::FOnPopupdDismissed and takes in a const TSharedRef& as an argument.

If you actually take a look at the error you received, it calls this out:

Error (active) E0304 no instance of overloaded function “TBaseDelegate ::CreateUObject [with WrappedRetValType=ILoginFlowManager::FOnPopupDismissed, ParamTypes= &>]” matches the argument list Comp f:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 77

Notice, it provides you with the correct signature

TBaseDelegate ::CreateUObject [with WrappedRetValType=ILoginFlowManager::FOnPopupDismissed, ParamTypes= &>]"

Then calls out where you were trying to improperly create it:

f:\Unreal Projects\Comp\Source\Comp\MyPlayerController.cpp 77

Again, I wouldn’t take the sample code above as anything but pseudo code. You’ll need to take a look at these errors and the actual implementations of things to come up with actual usable code.

Thanks,
Jon N.

Thanks again Jon. I really appreciate your time, and the detailed breakdown.

I corrected one typo, (for anyone following along) here:

ILoginFlowManager::FOnPopupdDismissed 

should be

ILoginFlowManager::FOnPopupDismissed 

And with that, it’s compiling.

It’s still not doing anything (to be expected). Where should I go to get help with the next part(s)? “create a login flow UI which contains the slate widget or native host widget blueprint implementable”

Should we do that here? Take it to a new thread?

Since we’re gotten past configuration and compilation, that maybe better off in another thread.

However, that’s probably something that’s more game specific and something you may need to work out more on your own.

Here are some docs to get you started writing slate, however.

Ok, I started a new thread for the UI, HERE

that’s probably something that’s more
game specific

How is a Facebook login game specific?

Granted, there could be some game-specific polish for the UI, but the basic login process will be the same for all games using facebook login, because it is defined in the Facebook OSS.

Thanks again.

Sorry, what I meant was that the UI specifically would be Game Specific.

Yes, the high level login logic for Facebook / Google would be somewhat the same, but the actual implementation of the UI will be up to you (how it looks, anything else it does, etc.)

Thanks,
Jon N.

Thanks Jon.

I’m just looking for assistance with the bare minimum to get the Login working. I don’t expect hand holding from you guys to make a gorgeous UI. I just want login to work.

I don’t understand why there is so much resistance here. Is facebook/google OSS no longer supported? Are you trying to discourage people from using it?

Going on a month now with no resolution to this issue. This is a blocker for everyone that is using fb/google on 4.16. /begs please please, can we get some more support on this issue so we can move on?

Any update? This is a blocker for me.

I was out for the last few weeks. I will try to get a rough example up by the end of next week on the other thread.

Would really appreciate resolution on this. TIA!

Giving this a bump as I need this fixed as well. :slight_smile:

Just got this working. Would be happy to help if you still have any issues.

Why did these (simple) engine fixes not get included in the 4.17 release?

https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Plugins/Online/OnlineFramework/OnlineFramework.uplugin