bEnableCloudKitSupport

bEnableCloudKitSupport

#Overview

name: bEnableCloudKitSupport

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. 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 bEnableCloudKitSupport is to control whether CloudKit support is enabled for the iOS platform in Unreal Engine 5. CloudKit is Apple’s cloud storage and database service that allows apps to store and sync data across devices.

This setting variable is primarily used by the iOS Online Subsystem, which is part of the OnlineSubsystemIOS plugin. The plugin is responsible for handling online functionality specific to iOS devices.

The value of this variable is set in the IOSRuntimeSettings class, which is part of the IOSRuntimeSettings module. It is defined as a UPROPERTY with the GlobalConfig and EditAnywhere attributes, allowing it to be configured in the project settings and edited in the Unreal Engine editor.

The bEnableCloudKitSupport variable interacts with the IOSCloudKitSyncStrategy variable, which determines the iCloud save files sync strategy. The IOSCloudKitSyncStrategy is only editable when bEnableCloudKitSupport is set to true.

Developers must be aware that this variable is false by default, as seen in the IOSRuntimeSettings constructor. They need to explicitly enable it if they want to use CloudKit functionality in their iOS app.

Best practices when using this variable include:

  1. Only enable it if your app requires CloudKit functionality, as it may have performance and resource implications.
  2. Ensure that your app is properly configured for CloudKit in the Apple Developer portal and Xcode project settings when enabling this feature.
  3. Consider the implications of enabling CloudKit on your app’s data storage and synchronization strategy.
  4. Test thoroughly on various iOS devices and iOS versions to ensure CloudKit functionality works as expected when enabled.
  5. Be aware of the potential impact on app review times, as apps using CloudKit may require additional scrutiny from Apple.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Online/IOS/OnlineSubsystemIOS/Source/Private/OnlineSubsystemIOS.cpp:317

Scope (from outer to inner):

file
function     bool FOnlineSubsystemIOS::IsCloudKitEnabled

Source code excerpt:

{
	bool bEnableCloudKit;
	GConfig->GetBool(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("bEnableCloudKitSupport"), bEnableCloudKit, GEngineIni);

	return bEnableCloudKit;
}

bool FOnlineSubsystemIOS::IsInAppPurchasingEnabled()
{

#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Classes/IOSRuntimeSettings.h:185

Scope (from outer to inner):

file
class        class UIOSRuntimeSettings : public UObject

Source code excerpt:

	// Should Cloud Kit support (iOS Online Subsystem) be enabled?
	UPROPERTY(GlobalConfig, EditAnywhere, Category = Online)
	bool bEnableCloudKitSupport;

	// iCloud Read stategy
	UPROPERTY(GlobalConfig, EditAnywhere, Category = Online, meta = (DisplayName = "iCloud save files sync strategy"), meta = (EditCondition = "bEnableCloudKitSupport"))
	EIOSCloudKitSyncStrategy IOSCloudKitSyncStrategy;

    // Should push/remote notifications support (iOS Online Subsystem) be enabled?

#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Private/IOSRuntimeSettings.cpp:26

Scope (from outer to inner):

file
function     UIOSRuntimeSettings::UIOSRuntimeSettings

Source code excerpt:

{
	bEnableGameCenterSupport = true;
	bEnableCloudKitSupport = false;
	bUserSwitching = false;
	bSupportsPortraitOrientation = true;
	bSupportsITunesFileSharing = false;
	bSupportsFilesApp = false;
	BundleDisplayName = TEXT("UnrealGame");
	BundleName = TEXT("MyUnrealGame");

#References in C# build files

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

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/IOS/IOSExports.cs:266

			{
				bool bCloudKitSupported = false;
				PlatformGameConfig.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableCloudKitSupport", out bCloudKitSupported);
				Directory.CreateDirectory(Path.GetDirectoryName(OutputFileName)!);
				// we need to have something so Xcode will compile, so we just set the get-task-allow, since we know the value,
				// which is based on distribution or not (true means debuggable)
				StringBuilder Text = new StringBuilder();
				Text.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
				Text.AppendLine("<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">");