bUsePopup
bUsePopup
#Overview
name: bUsePopup
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bUsePopup is to control the display mode of the Facebook login interface in the Online Subsystem Facebook plugin for Unreal Engine. Specifically, it determines whether the login URL should include a parameter to request a popup display for the authentication process.
This setting variable is primarily used by the Online Subsystem Facebook plugin, which is part of Unreal Engine’s online services framework. It’s specifically utilized within the identity management component of this subsystem.
The value of this variable is set in the DefaultEngine.ini configuration file, under the [OnlineSubsystemFacebook.OnlineIdentityFacebook] section. If not explicitly set, it defaults to false as seen in the FFacebookLoginURL constructor.
bUsePopup interacts with other variables in the FFacebookLoginURL struct, such as LoginUrl, LoginRedirectUrl, ClientId, State, and Scopes. These variables collectively construct the complete Facebook login URL.
Developers must be aware that:
- This setting affects the user experience during Facebook login.
- Using a popup might be more suitable for some platforms or scenarios, but may not be ideal for others.
- The setting’s value should align with the Facebook application’s configuration and expected user flow.
Best practices when using this variable include:
- Carefully consider the target platforms and user experience before enabling or disabling the popup.
- Ensure that the Facebook application is configured correctly to handle both popup and non-popup login flows.
- Test the login process thoroughly with both settings to ensure a smooth user experience.
- Document the chosen setting and the rationale behind it for future reference and team communication.
- Be mindful of potential platform-specific behaviors or restrictions when using popups for authentication.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2288, section: [OnlineSubsystemFacebook.OnlineIdentityFacebook]
- INI Section:
OnlineSubsystemFacebook.OnlineIdentityFacebook
- Raw value:
true
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemFacebook/Source/Private/Rest/OnlineIdentityFacebookRest.cpp:19
Scope (from outer to inner):
file
function FOnlineIdentityFacebook::FOnlineIdentityFacebook
Source code excerpt:
UE_LOG_ONLINE_IDENTITY(Warning, TEXT("Missing LoginRedirectUrl= in [OnlineSubsystemFacebook.OnlineIdentityFacebook] of DefaultEngine.ini"));
}
if (!GConfig->GetBool(TEXT("OnlineSubsystemFacebook.OnlineIdentityFacebook"), TEXT("bUsePopup"), LoginURLDetails.bUsePopup, GEngineIni))
{
UE_LOG_ONLINE_IDENTITY(Warning, TEXT("Missing bUsePopup= in [OnlineSubsystemFacebook.OnlineIdentityFacebook] of DefaultEngine.ini"));
}
GConfig->GetArray(TEXT("OnlineSubsystemFacebook.OnlineIdentityFacebook"), TEXT("LoginDomains"), LoginDomains, GEngineIni);
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemFacebook/Source/Private/Rest/OnlineIdentityFacebookRest.h:34
Scope: file
Source code excerpt:
FString State;
/** Should the URL include the popup display size */
bool bUsePopup;
FFacebookLoginURL()
: bUsePopup(false)
{ }
bool IsValid() const
{
return !LoginUrl.IsEmpty() && !LoginRedirectUrl.IsEmpty() && !ClientId.IsEmpty();
}
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemFacebook/Source/Private/Rest/OnlineIdentityFacebookRest.h:69
Scope (from outer to inner):
file
function FString GetURL
Source code excerpt:
// auth url to spawn in browser
return FString::Printf(TEXT("%s?redirect_uri=%s&client_id=%s&state=%s&response_type=token&scope=%s%s"),
*LoginUrl, *LoginRedirectUrl, *ClientId, *State, *Scopes, bUsePopup ? TEXT("&display=popup") : TEXT(""));
}
};
/**
* Facebook service implementation of the online identity interface
*/