APIVer
APIVer
#Overview
name: APIVer
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 APIVer is to store and manage the version of the Facebook API being used within the OnlineSubsystemFacebook plugin for Unreal Engine 5. This setting variable is crucial for ensuring compatibility between the game’s online features and the specific version of the Facebook API being utilized.
The OnlineSubsystemFacebook plugin relies on this setting variable. It is a part of the online subsystem framework in Unreal Engine, which handles various online functionalities, including social features and authentication.
The value of this variable is set in two ways:
- It is primarily read from the DefaultEngine.ini configuration file, specifically from the [OnlineSubsystemFacebook] section with the key “APIVer”.
- If the value is not found in the configuration file, it falls back to a default value defined by FACEBOOK_API_VER.
The APIVer variable interacts with other components of the FOnlineSubsystemFacebookCommon class, such as the FacebookIdentity and FacebookFriends interfaces, which likely use this version information to ensure proper API calls.
Developers must be aware of the following when using this variable:
- The APIVer needs to be correctly set in the DefaultEngine.ini file to match the Facebook app settings.
- Changes in the Facebook API may require updating this value to maintain compatibility.
- The variable is crucial for the proper functioning of Facebook-related online features in the game.
Best practices when using this variable include:
- Always specify the APIVer in the DefaultEngine.ini file to avoid relying on the default value.
- Keep the APIVer up to date with the latest supported version of the Facebook API for your application.
- Test thoroughly after updating the APIVer to ensure all Facebook-related features continue to work correctly.
- Document the current APIVer being used in your project to facilitate easier maintenance and troubleshooting.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2281, section: [OnlineSubsystemFacebook]
- INI Section:
OnlineSubsystemFacebook
- Raw value:
"v15.0"
- 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/OnlineSubsystemFacebookCommon.cpp:35
Scope (from outer to inner):
file
function bool FOnlineSubsystemFacebookCommon::Init
Source code excerpt:
}
if (!GConfig->GetString(TEXT("OnlineSubsystemFacebook"), TEXT("APIVer"), APIVer, GEngineIni))
{
UE_LOG_ONLINE(Warning, TEXT("Missing APIVer= in [OnlineSubsystemFacebook] of DefaultEngine.ini"));
APIVer = FACEBOOK_API_VER;
}
return true;
}
bool FOnlineSubsystemFacebookCommon::Shutdown()
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemFacebook/Source/Private/OnlineSubsystemFacebookCommon.h:78
Scope (from outer to inner):
file
class class FOnlineSubsystemFacebookCommon : public FOnlineSubsystemImpl
function const FString& GetAPIVer
Source code excerpt:
/** @return the API version in use (depends on the Facebook app settings) */
const FString& GetAPIVer() const { return APIVer; }
/**
* Destructor
*/
virtual ~FOnlineSubsystemFacebookCommon();
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemFacebook/Source/Private/OnlineSubsystemFacebookCommon.h:96
Scope (from outer to inner):
file
class class FOnlineSubsystemFacebookCommon : public FOnlineSubsystemImpl
Source code excerpt:
FString ClientId;
/** Version of the API in use (depends on the Facebook app settings) */
FString APIVer;
/** Facebook implementation of identity interface */
FOnlineIdentityFacebookCommonPtr FacebookIdentity;
/** Facebook implementation of friends interface */
FOnlineFriendsFacebookCommonPtr FacebookFriends;