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:
Add your google-services.json
file to the project's root directory. It will be used to configure notifications during the project-building process.
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
):
class UDTDMessagingBPLibrary
A class that implements analytic methods.
Header file:
enum class EDTDNotificationActionType : uint8
Notification action type
Header file:
Values:
App = 0
- default value
Url = 1
- external link opening
Share = 2
- share contentc
DeepLink = 2
- an in-app link opening
struct FDTDNotification
Notification data container.
Header file:
struct FDTDNotificationAction
Notification action data container.
Header file:
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
- nothing
Badge = 1 << 0
- can display a badge on the app icon
Sound = 1 << 1
- can play a sound
Alert = 1 << 2
- can display an alert
CarPlay = 1 << 3
- can display a push notification on CarPlay
CriticalAlert = 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
Header file:
Delegates:
Notification module initialization:
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
Get the current availability
status flag (true or false):
GetToken
Get a current unique device ID used in the notification system:
SetTokenListener
Set a token listener. The listener will be executed when the SDK updates a unique device ID in the notification system.
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.
SetNotificationReceiveListener
Set a listener for notification reception. The listener will be executed when the SDK receives a notification.
SetInvisibleNotificationReceiveListener
Set a listener for invisible notification reception. The listener will be executed when the SDK receives an invisible notification.
SetNotificationActionListener
Set a listener for notification activation. The listener will be executed when the notification gets activated.
IOSSetNotificationOptions
iOS only
Set notification parameters.
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.
Member | Type | Description |
---|---|---|
Member | Type | Description |
---|---|---|
Arguments | Type | Description |
---|---|---|
Arguments | Type | Description |
---|---|---|
Arguments | Type | Description |
---|---|---|
Arguments | Type | Description |
---|---|---|
Arguments | Type | Description |
---|---|---|
Arguments | Type | Description |
---|---|---|
Arguments | Type | Description |
---|---|---|
Arguments | Type | Description |
---|---|---|
ActionType
EDTDNotificationActionType
Тип действия уведомления
ActionString
FString
Идентификатор действия уведомления
Data
TMap<FString, FString>
Данные уведомления
ActionType
EDTDNotificationActionType
Тип действия уведомления
ActionString
FString
Идентификатор действия уведомления
ButtonId
FString
Идентификатор нажатой кнопки
ButtonText
FString
Текст нажатой кнопки
ButtonIcon
FString
Иконка нажатой кнопки
IsBackground
bool
Режим открытия приложения кнопкой
onResult
FDTDMessagingDynamicBoolParamsDelegate
FDTDMessagingBoolParamsDelegate
Callback
onResult
FDTDMessagingDynamicStringParamsDelegate
FDTDMessagingStringParamsDelegate
Callback.
listener
FDTDMessagingDynamicStringParamsDelegate
FDTDMessagingStringParamsDelegate
Listener.
listener
FDTDMessagingDynamicStringParamsDelegate
FDTDMessagingStringParamsDelegate
Listener.
listener
FDTDMessagingDynamicNotificationParamsDelegate
FDTDMessagingNotificationParamsDelegate
Listener.
listener
FDTDMessagingDynamicNotificationParamsDelegate
FDTDMessagingNotificationParamsDelegate
Listener.
listener
FDTDMessagingDynamicNotificationActionParamsDelegate
FDTDMessagingNotificationActionParamsDelegate
Listener.
options
int32
Options.