bEnableGooglePlaySupport

bEnableGooglePlaySupport

#Overview

name: bEnableGooglePlaySupport

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 4 C++ source files. Also referenced in 1 C# build file meaning it may affect the build system logic.

#Summary

#Usage in the C++ source code

The purpose of bEnableGooglePlaySupport is to enable or disable Google Play support for Android applications developed using Unreal Engine 5. This setting is specifically related to the Android platform and Google Play Services integration.

This setting variable is primarily relied upon by the OnlineSubsystemGooglePlay module, which is part of the Android-specific online subsystem in Unreal Engine. It’s used in the Android Runtime Settings and is relevant to the Android platform editor.

The value of this variable is set in the Android Runtime Settings, which can be accessed and modified through the Unreal Engine editor. It’s defined as a UPROPERTY with GlobalConfig and EditAnywhere attributes, making it editable in the project settings.

This variable interacts with other Google Play Services related settings, such as GamesAppID, RequestCodeForPlayGamesActivities, and PlayGamesClientId. These settings work together to configure Google Play integration for the Android application.

Developers must be aware that enabling this setting is crucial for utilizing Google Play features in their Android games. It’s a prerequisite for functionalities like achievements, leaderboards, and other Google Play Games services.

Best practices when using this variable include:

  1. Ensure it’s enabled if you plan to use any Google Play services in your game.
  2. Properly configure other related settings (like GamesAppID) when enabling this option.
  3. Be mindful of the implications on your game’s functionality and testing requirements when changing this setting.
  4. Consider the target audience and distribution plans for your game when deciding whether to enable Google Play support.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3037, section: [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Online/Android/OnlineSubsystemGooglePlay/Source/Private/OnlineSubsystemGooglePlay.cpp:203

Scope (from outer to inner):

file
function     bool FOnlineSubsystemGooglePlay::IsEnabled

Source code excerpt:


	// AndroidRuntimeSettings holds a value for editor ease of use
	if (!GConfig->GetBool(TEXT("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings"), TEXT("bEnableGooglePlaySupport"), bEnabled, GEngineIni))
	{
		UE_LOG_ONLINE(Warning, TEXT("The [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]:bEnableGooglePlaySupport flag has not been set"));

		// Fallback to regular OSS location
		bEnabled = FOnlineSubsystemImpl::IsEnabled();
	}

#Loc: <Workspace>/Engine/Source/Developer/Android/AndroidPlatformEditor/Private/AndroidTargetSettingsCustomization.cpp:255

Scope (from outer to inner):

file
function     void FAndroidTargetSettingsCustomization::BuildAppManifestSection

Source code excerpt:

		];

	TSharedRef<IPropertyHandle> EnabledProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, bEnableGooglePlaySupport));
	GooglePlayCategory.AddProperty(EnabledProperty)
		.EditCondition(SetupForGooglePlayAttribute, NULL);

	TSharedRef<IPropertyHandle> AppIDProperty = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, GamesAppID));
	AppIDProperty->SetOnPropertyValueChanged(FSimpleDelegate::CreateRaw(this, &FAndroidTargetSettingsCustomization::OnAppIDModified));
	GooglePlayCategory.AddProperty(AppIDProperty)

#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Classes/AndroidRuntimeSettings.h:479

Scope (from outer to inner):

file
class        class UAndroidRuntimeSettings : public UObject

Source code excerpt:

	// Should Google Play support be enabled?
	UPROPERTY(GlobalConfig, EditAnywhere, Category = GooglePlayServices)
	bool bEnableGooglePlaySupport;

	UPROPERTY(GlobalConfig, EditAnywhere, Category = GooglePlayServices, meta = (DisplayName = "Request code for showing GooglePlay Games activities"), meta = (ToolTip = "This request code is reported in onActivityResult when Achievements or Leaderboards UIs are closed"))
	int RequestCodeForPlayGamesActivities;

	UPROPERTY(GlobalConfig, EditAnywhere, Category = GooglePlayServices, meta = (DisplayName = "GooglePlay Games Oauth Client ID registered for game server"), meta = (ToolTip = "No auth code will be requested on login if empty. Setting up Server-side API Access (see https://developers.google.com/games/services/android/offline-access)"))
	FString PlayGamesClientId;

#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Private/AndroidRuntimeSettings.cpp:24

Scope (from outer to inner):

file
function     UAndroidRuntimeSettings::UAndroidRuntimeSettings

Source code excerpt:

	, bAndroidVoiceEnabled(false)
	, bPackageForMetaQuest(false)
	, bEnableGooglePlaySupport(false)
	, RequestCodeForPlayGamesActivities(80002)
	, bForceRefreshToken(false)
	, bSupportAdMob(true)
	, bBlockAndroidKeysOnControllers(false)
	, AudioSampleRate(44100)
	, AudioCallbackBufferFrameSize(1024)

#References in C# build files

This variable is referenced in the following C# build files:

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEDeployAndroid.cs:3202

			ConfigHierarchy Ini = GetConfigCacheIni(ConfigHierarchyType.Engine);
			bool bEnableGooglePlaySupport;
			Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bEnableGooglePlaySupport", out bEnableGooglePlaySupport);

			if (!bEnableGooglePlaySupport)
			{
				// do not need to do anything; it is fine
				return;
			}