Skip to main content

Showing the invite overlay

You can use the external UI interface to show the "invite a friend" overlay. On Steam, this opens the overlay with a list of friends and the "invite" button shown next to them. The user can then send invites to any number of friends on their friends list to the current session.

For this to work, the EOS session must have presence enabled (bUsesPresence turned on), and the "Project Settings" must have "Presence Advertises" set to "Session".

Configuring the external UI for the local platform on PC

On mobile and console platforms, this is already done for you. However on PC, you'll need to tell Unreal Engine which store your build is for, so that the external UI calls get routed correctly.

If you're shipping on Steam, you should set the following entry in DefaultEngine.ini:

[OnlineSubsystem]
NativePlatformService=Steam
caution

If you don't have a NativePlatformService set, you won't be able to use any external UI calls except for showing the friends list, and even then only when the user is signed into an Epic Games account.

Showing the invite overlay

To show the invite overlay, first get the external UI interface:

#include "OnlineSubsystem.h"
#include "OnlineSubsystemUtils.h"
#include "Interfaces/OnlineExternalUIInterface.h"

// ...

IOnlineSubsystem* Subsystem = Online::GetSubsystem(this->GetWorld());
IOnlineExternalUIPtr ExternalUI = Subsystem->GetExternalUIInterface();

Then, open the invite UI for the local user and the given session:

ExternalUI->ShowFriendsUI(
0 /* The controller index of the local user */,
FName(TEXT("GameSession")) /* The name of the session to invite friends to */);