Unreal Engine
Plugin installation
The SDK can be found in the devtodev GitHub repository. Download the latest release of the Source code (zip). Unzip the archive and copy the DTDMessaging
folder to the Plugins folder of your project.
If you have a C++ type project, add DTDMessaging
to the list of dependency names in the <module_name>.Build.cs
file of the module in which you plan to use the plugin.
Example:
Android
Add your google-services.json
file to the project's root directory. It will be used to configure notifications during the project-building process.
iOS
In the case your Unreal Engine is built from GitHub source code:
Enable notifications in the settings of your project: Edit → Project Settings → iOS → Enable Remote Notifications Support
In the case your Unreal Engine is not built from GitHub source code:
Add the parameter to the engine configuration file (<proj_dir>/Config/DefaultEngine.ini
):
Data types
class UDTDMessagingBPLibrary
class UDTDMessagingBPLibrary
A class that implements analytic methods.
Header file:
enum class EDTDNotificationActionType : uint8
enum class EDTDNotificationActionType : uint8
Notification action type
Header file:
Values:
App = 0
- default valueUrl = 1
- external link openingShare = 2
- share contentcDeepLink = 2
- an in-app link opening
struct FDTDNotification
struct FDTDNotification
Notification data container.
Header file:
ActionType
EDTDNotificationActionType
Тип действия уведомления
ActionString
FString
Идентификатор действия уведомления
Data
TMap<FString, FString>
Данные уведомления
struct FDTDNotificationAction
struct FDTDNotificationAction
Notification action data container.
Header file:
ActionType
EDTDNotificationActionType
Тип действия уведомления
ActionString
FString
Идентификатор действия уведомления
ButtonId
FString
Идентификатор нажатой кнопки
ButtonText
FString
Текст нажатой кнопки
ButtonIcon
FString
Иконка нажатой кнопки
IsBackground
bool
Режим открытия приложения кнопкой
enum class EDTDIOSNotificationOptions : uint8
enum class EDTDIOSNotificationOptions : uint8
iOS only
Push Notification display settings are Bitflags
that are managed by the developer and allow for selecting the method of user notification. It can be altered by the end user.
By default, it has the value: Badge|Sound|Alert
Header file:
Values:
None = 0
- nothingBadge = 1 << 0
- can display a badge on the app iconSound = 1 << 1
- can play a soundAlert = 1 << 2
- can display an alertCarPlay = 1 << 3
- can display a push notification on CarPlayCriticalAlert = 1 << 4
- critical alerts can play a sound even if Do Not Disturb is enabled (critical alerts require a special entitlement issued by Apple). Available from iOS 12 onwards.AppNotificationSettings = 1 << 5
- this option defines that the system should display a notification settings button in the app. Available from iOS 12.0 onwards.Provisional = 1 << 6
- an option for sending provisional notifications to the Notification Center without interrupting functioning processes. Available from iOS 12.0 onwards.
Provisional - Provisional push notifications are shown in the User Notification Center but not on the lock screen. This type of push notification doesn’t require an explicit opt-in from the user. You can start sending them as soon as the user installs and launches your app. However, the user can also explicitly enable/disable your notifications.
Use this setting to avoid the permission request on app launch because it is seen as intrusive, and most users opt out of it.
It’s also important that when using the Provisional setting, the user needs to go to Notification Center settings to allow explicit notifications.
Delegates
Delegates
Header file:
Delegates:
Initialization
Notification module initialization:
Methods
SetAvailability
SetAvailability
A method responsible for enabling/disabling push notifications. When the state changes, it sends an event that includes the availability status (true or false). The availability status flag is stored in the SDK.
GetAvailability
GetAvailability
Get the current availability
status flag (true or false):
onResult
FDTDMessagingDynamicBoolParamsDelegate
FDTDMessagingBoolParamsDelegate
Callback
GetToken
GetToken
Get a current unique device ID used in the notification system:
onResult
FDTDMessagingDynamicStringParamsDelegate
FDTDMessagingStringParamsDelegate
Callback.
SetTokenListener
SetTokenListener
Set a token listener. The listener will be executed when the SDK updates a unique device ID in the notification system.
listener
FDTDMessagingDynamicStringParamsDelegate
FDTDMessagingStringParamsDelegate
Listener.
SetTokenErrorListener
SetTokenErrorListener
Set a listener for errors in token reception. The listener will be executed when an error occurs while the SDK updates a unique device ID in the notification system.
listener
FDTDMessagingDynamicStringParamsDelegate
FDTDMessagingStringParamsDelegate
Listener.
SetNotificationReceiveListener
SetNotificationReceiveListener
Set a listener for notification reception. The listener will be executed when the SDK receives a notification.
listener
FDTDMessagingDynamicNotificationParamsDelegate
FDTDMessagingNotificationParamsDelegate
Listener.
SetInvisibleNotificationReceiveListener
SetInvisibleNotificationReceiveListener
Set a listener for invisible notification reception. The listener will be executed when the SDK receives an invisible notification.
listener
FDTDMessagingDynamicNotificationParamsDelegate
FDTDMessagingNotificationParamsDelegate
Listener.
SetNotificationActionListener
SetNotificationActionListener
Set a listener for notification activation. The listener will be executed when the notification gets activated.
listener
FDTDMessagingDynamicNotificationActionParamsDelegate
FDTDMessagingNotificationActionParamsDelegate
Listener.
IOSSetNotificationOptions
IOSSetNotificationOptions
iOS only
Set notification parameters.
options
int32
Options.
An int32 type value is used as an argument of this method. However, this argument should be calculated by using enumerators of EDTDIOSNotificationOptions
and bitwise OR operator.
Last updated