bEnableRemoteNotificationsSupport
bEnableRemoteNotificationsSupport
#Overview
name: bEnableRemoteNotificationsSupport
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 2
C++ source files. Also referenced in 4
C# build files meaning it may affect the build system logic.
#Summary
#Usage in the C# source code and build system
The purpose of bEnableRemoteNotificationsSupport is to enable or disable remote notification support for iOS and tvOS applications built with Unreal Engine 5. This setting is specifically related to the push notification system for mobile devices.
This setting variable is primarily used by the iOS and tvOS build systems within Unreal Engine. It’s referenced in the IOSExports.cs, UEBuildIOS.cs, and UEDeployIOS.cs files, which are part of the iOS platform-specific build tools.
The value of this variable is set in the IOSRuntimeSettings configuration file, which is typically located in the project’s Config folder. It can be modified through the project settings in the Unreal Editor or by directly editing the configuration file.
This variable interacts with other iOS-specific settings, particularly:
- bCloudKitSupported
- bForDistribution
- bSupportsBackgroundAudio
- bEnableBackgroundFetch
Developers must be aware that:
- For tvOS, remote notifications are automatically enabled when building for distribution with CloudKit support, regardless of this setting’s value.
- Enabling this option will add the “remote-notifications” capability to the app’s background modes.
- This setting affects the generated Info.plist file and potentially the app’s capabilities in Xcode.
Best practices when using this variable include:
- Only enable it if your app genuinely requires push notifications to function.
- Ensure that you have the necessary server-side infrastructure to support push notifications if you enable this feature.
- Be aware of Apple’s guidelines and requirements for push notifications when implementing this feature.
- Test thoroughly on both development and production environments to ensure proper functionality.
Regarding the associated variable bEnableBackgroundFetch:
The purpose of bEnableBackgroundFetch is to enable or disable background fetch capabilities for iOS applications built with Unreal Engine 5. This allows the app to update its content in the background at intervals determined by the system.
This setting is also used by the iOS build system, particularly in the UEBuildIOS.cs file.
Like bEnableRemoteNotificationsSupport, this variable is set in the IOSRuntimeSettings configuration file.
It interacts with other iOS-specific settings, particularly those related to background modes and capabilities.
Developers should be aware that:
- Enabling this option will add the “fetch” capability to the app’s background modes.
- Background fetch can impact battery life, so it should be used judiciously.
- The actual frequency of background fetches is determined by the iOS system based on the app’s usage patterns.
Best practices for using this variable include:
- Only enable it if your app requires periodic background updates to maintain freshness of content.
- Implement efficient background fetch routines to minimize battery impact.
- Test thoroughly to ensure that background fetches are working as expected and not causing any performance issues.
- Be mindful of Apple’s guidelines regarding background execution and energy efficiency.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:3018, section: [/Script/IOSRuntimeSettings.IOSRuntimeSettings]
- INI Section:
/Script/IOSRuntimeSettings.IOSRuntimeSettings
- Raw value:
False
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Classes/IOSRuntimeSettings.h:193
Scope (from outer to inner):
file
class class UIOSRuntimeSettings : public UObject
Source code excerpt:
// Should push/remote notifications support (iOS Online Subsystem) be enabled?
UPROPERTY(GlobalConfig, EditAnywhere, Category = Online)
bool bEnableRemoteNotificationsSupport;
// Should background fetch support be enabled?
UPROPERTY(GlobalConfig, EditAnywhere, Category = Online)
bool bEnableBackgroundFetch;
// Whether or not to compile iOS Metal shaders for the Mobile renderer (requires iOS 8+ and an A7 processor).
#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Private/IOSRuntimeSettings.cpp:55
Scope (from outer to inner):
file
function UIOSRuntimeSettings::UIOSRuntimeSettings
Source code excerpt:
bAllowRemoteRotation = true;
bDisableMotionData = false;
bEnableRemoteNotificationsSupport = false;
bEnableBackgroundFetch = false;
bSupportsMetal = true;
bSupportsMetalMRT = false;
bSupportHighRefreshRates = false;
bDisableHTTPS = false;
bSupportsBackgroundAudio = false;
#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:308
bool bRemoteNotificationsSupported = false;
PlatformGameConfig.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableRemoteNotificationsSupport", out bRemoteNotificationsSupported);
// for TVOS we need push notifications when building for distribution with CloudKit
if (bCloudKitSupported && bForDistribution && Platform == UnrealTargetPlatform.TVOS)
{
bRemoteNotificationsSupported = true;
}
Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/IOS/UEBuildIOS.cs:290
/// true if notifications are enabled
/// </summary>
[ConfigFile(ConfigHierarchyType.Engine, "/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableRemoteNotificationsSupport")]
public readonly bool bNotificationsEnabled = false;
/// <summary>
/// true if notifications are enabled
/// </summary>
[ConfigFile(ConfigHierarchyType.Engine, "/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableBackgroundFetch")]
Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/IOS/UEDeployIOS.cs:651
// Add remote-notifications as background mode
bool bRemoteNotificationsSupported = false;
Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableRemoteNotificationsSupport", out bRemoteNotificationsSupported);
// Add audio as background mode
bool bBackgroundAudioSupported = false;
Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsBackgroundAudio", out bBackgroundAudioSupported);
// Add background fetch as background mode
Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/IOS/UEDeployIOS.cs:295
// Add remote-notifications as background mode
bool bRemoteNotificationsSupported = false;
Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableRemoteNotificationsSupport", out bRemoteNotificationsSupported);
// Add audio as background mode
bool bBackgroundAudioSupported = false;
Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsBackgroundAudio", out bBackgroundAudioSupported);
// Add background fetch as background mode