DefaultNotificationText_Approve
DefaultNotificationText_Approve
#Overview
name: DefaultNotificationText_Approve
The value of this variable can be defined or overridden in .ini config files. 13
.ini config files referencing this setting variable.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of DefaultNotificationText_Approve is to provide a localized text for the approval notification in Android background HTTP downloads. This setting variable is used to display a user-friendly message when the system requires user approval for a background download operation.
This setting variable is primarily used by the Android Fetch Background Download plugin, which is part of the Unreal Engine’s online subsystem for Android platforms. Specifically, it’s utilized in the FAndroidPlatformBackgroundHttpManager class, which manages background HTTP requests on Android devices.
The value of this variable is set through the InitFromIniSettings function, which reads the configuration from an INI file. The exact location of this INI file is not specified in the provided code snippets, but it’s likely to be in the project’s configuration directory.
This variable interacts with other similar notification text variables, such as DefaultNotificationText_NoInternet and DefaultNotificationText_WaitingForCellular. They are all part of the FAndroidBackgroundHTTPManagerDefaultLocalizedText struct, which holds various localized texts for different scenarios in background downloads.
Developers should be aware that this variable is used to populate a notification that may be shown to end-users. Therefore, it’s crucial to provide appropriate, clear, and concise text that guides the user to approve the background download when necessary.
Best practices when using this variable include:
- Ensuring that the text is properly localized for all supported languages.
- Keeping the message brief and clear, as it will be displayed in a notification.
- Regularly reviewing and updating the text to ensure it remains relevant and accurate.
- Testing the notification system thoroughly to ensure the text is displayed correctly in various scenarios.
- Considering the context in which this approval message will be shown and tailoring it accordingly to improve user experience.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:104, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("native","Approve")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:105, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("ar","السماح")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:106, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("de","Bestätigen")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:107, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("es","Aprobar")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:108, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("es-419","Aprobar")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:109, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("fr","Autoriser")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:110, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("it","Autorizza")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:111, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("ja","許可する")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:112, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("ko","승인")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:113, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("pl","Zatwierdź")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:114, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("pt-BR","Autorizar")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:115, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("ru","Разрешить")
- Is Array:
True
Location: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Config/BaseAndroidFetchBackgroundDownload.ini:116, section: [AndroidBackgroundHTTP.DefaultTextLoc]
- INI Section:
AndroidBackgroundHTTP.DefaultTextLoc
- Raw value:
("tr","Onayla")
- Is Array:
True
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Source/AndroidFetchBackgroundDownload/Private/AndroidPlatformBackgroundHttpManager.cpp:359
Scope (from outer to inner):
file
function void FAndroidPlatformBackgroundHttpManager::ActivatePendingRequests
Source code excerpt:
WorkParams.AddDataToWorkerParameters(FAndroidNativeDownloadWorkerParameterKeys::NOTIFICATION_CONTENT_NO_INTERNET_TEXT_KEY, AndroidBackgroundHTTPManagerDefaultLocalizedText.DefaultNotificationText_NoInternet.GetText());
WorkParams.AddDataToWorkerParameters(FAndroidNativeDownloadWorkerParameterKeys::NOTIFICATION_CONTENT_WAITING_FOR_CELLULAR_TEXT_KEY, AndroidBackgroundHTTPManagerDefaultLocalizedText.DefaultNotificationText_WaitingForCellular.GetText());
WorkParams.AddDataToWorkerParameters(FAndroidNativeDownloadWorkerParameterKeys::NOTIFICATION_CONTENT_APPROVE_TEXT_KEY, AndroidBackgroundHTTPManagerDefaultLocalizedText.DefaultNotificationText_Approve.GetText());
//Expect our ContentText to have a {DownloadPercent} argument in it by default, so this will replace that with the Java string format argument so Java can insert the appropriate value
FFormatNamedArguments Arguments;
Arguments.Emplace(TEXT("DownloadPercent"), FText::FromString(TEXT("%02d%%")));
FText UpdatedContentText = FText::Format(AndroidBackgroundHTTPManagerDefaultLocalizedText.DefaultNotificationText_Content.GetText(), Arguments);
WorkParams.AddDataToWorkerParameters(FAndroidNativeDownloadWorkerParameterKeys::NOTIFICATION_CONTENT_TEXT_KEY, UpdatedContentText);
#Loc: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Source/AndroidFetchBackgroundDownload/Private/AndroidPlatformBackgroundHttpManager.cpp:1041
Scope (from outer to inner):
file
function FAndroidPlatformBackgroundHttpManager::FAndroidBackgroundHTTPManagerDefaultLocalizedText::FAndroidBackgroundHTTPManagerDefaultLocalizedText::FAndroidBackgroundHTTPManagerDefaultLocalizedText
Source code excerpt:
, DefaultNotificationText_NoInternet()
, DefaultNotificationText_WaitingForCellular()
, DefaultNotificationText_Approve()
{
}
void FAndroidPlatformBackgroundHttpManager::FAndroidBackgroundHTTPManagerDefaultLocalizedText::InitFromIniSettings(const FString& ConfigFileName)
{
if (ensureAlwaysMsgf(GConfig, TEXT("Invalid GConfig, can not load default localization strings for this manager!")))
#Loc: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Source/AndroidFetchBackgroundDownload/Private/AndroidPlatformBackgroundHttpManager.cpp:1096
Scope (from outer to inner):
file
function void FAndroidPlatformBackgroundHttpManager::FAndroidBackgroundHTTPManagerDefaultLocalizedText::InitFromIniSettings
Source code excerpt:
}
//DefaultNotificationText_Approve
{
TArray<FString> ApproveTextStrings;
Config->GetArray(*TextConfigSection, TEXT("DefaultNotificationText_Approve"), ApproveTextStrings);
ParsePolyglotTextItem(DefaultNotificationText_Approve, TEXT("Notification.ApproveText"), ApproveTextStrings);
}
}
}
//Even if the above ends up in parse errors we want to ensure here, but also generate a valid Polyglot text so we can bubble up the error into the notification without crashing
#Loc: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Source/AndroidFetchBackgroundDownload/Private/AndroidPlatformBackgroundHttpManager.cpp:1113
Scope (from outer to inner):
file
function void FAndroidPlatformBackgroundHttpManager::FAndroidBackgroundHTTPManagerDefaultLocalizedText::InitFromIniSettings
Source code excerpt:
ForceValidPolyglotText(DefaultNotificationText_NoInternet, TEXT("DefaultNotificationText_NoInternet"));
ForceValidPolyglotText(DefaultNotificationText_WaitingForCellular, TEXT("DefaultNotificationText_WaitingForCellular"));
ForceValidPolyglotText(DefaultNotificationText_Approve, TEXT("DefaultNotificationText_Approve"));
}
void FAndroidPlatformBackgroundHttpManager::FAndroidBackgroundHTTPManagerDefaultLocalizedText::ForceValidPolyglotText(FPolyglotTextData& TextDataOut, const FString& DebugPolyglotTextName)
{
FText FailureReason;
if (!ensureAlwaysMsgf(TextDataOut.IsValid(&FailureReason), TEXT("Invalid .ini settings for %s! Invalid localization found! FailureReason: %s"), *DebugPolyglotTextName, *(FailureReason.ToString())))
#Loc: <Workspace>/Engine/Plugins/Online/Android/AndroidFetchBackgroundDownload/Source/AndroidFetchBackgroundDownload/Public/AndroidPlatformBackgroundHttpManager.h:158
Scope (from outer to inner):
file
class class FAndroidPlatformBackgroundHttpManager : public FBackgroundHttpManagerImpl
Source code excerpt:
FPolyglotTextData DefaultNotificationText_NoInternet;
FPolyglotTextData DefaultNotificationText_WaitingForCellular;
FPolyglotTextData DefaultNotificationText_Approve;
void InitFromIniSettings(const FString& ConfigFileName);
private:
//Fills out a FPolyglotTextData with data from the supplied text entry parsed from the config.ini