Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
WSA Integration
For the Messaging module to function you need the basic Analytics package. Before the notification initialization, you need to initialize the SDK. More about it you can read here: Unity Integration.
Add the DTDAnalytics
initialization block after the DTDMessaging
initialization block.
Attention! Use the #if UNITY_WSA
define to surround any notification module code on the WSA platform.
Use the following method to check current status:
The current module status will be sent to onGetMessagingEnabling
callback.
You can listen to basic events of the Messaging module: create the class that implements the IDTDPushListener
interface and send it to the DTDMessaging.WSA.SetPushListener
method.
Class example:
A complete example of notification module initialization:
Build a Windows Store App in Unity. After the app is built, a Visual Studio project will be created. Proceed with the following changes.
There is a difference in the implementation of the elements mentioned below for different types of projects:
Put the following source in your App class (usually it is App.xaml.cpp
file). Add several lines of code in a generated App.xaml.cpp
class. After defining headers:
And at the end of of the App::OnLaunched(LaunchActivatedEventArgs^ e)
and App::OnActivated(IActivatedEventArgs^ args)
functions.
For Example:
Put the following source in your App class (usually it is App.cpp file). Add several lines of code in a generated App.cpp class. After defining headers:
And at the end of of the App::OnActivated(CoreApplicationView^ sender, IActivatedEventArgs^ args
) function.
Besides, in the UI editor of the Package.appxmanifest
file you need to do the following:
Add Background Tasks in the Declarations tab and mark it as System Event
. After that, add DevToDev.Background.ToastNotificationBackgroundTask
to the Entry Point field
.
Add Background Tasks in the Declarations tab and mark it as Push Notification
. After that, add DevToDev.Background.RawNotificationBackgroundTask
to the Entry Point field
.
To disable notifications, call the following method:
Method | Description |
---|---|
void DTDMessaging.WSA.SetMessagingEnabling(bool value)
The method responsible for enabling or disabling of the push notification module
void DTDMessaging.WSA.GetMessagingEnabling(Action<bool> onGetMessagingEnabling)
The method that returns current state of the push notification module to onGetMessagingEnabling callback
void DTDMessaging.WSA.SetPushListener (IDTDPushListener pushListener)
It sets a listener for push notification event trapping
CocoaPods is the easiest way to add devtodev into your iOS project.
1. Firstly, install CocoaPods using:
2. In the project directory execute the command:
3. In the created Podfile add the dependency:
4. Finally, run the command in your Xcode project directory:
CocoaPods should download and install the devtodev library, and create a new Xcode workspace. Open this workspace in Xcode.
To connect the module for processing push notifications, you need to:
1. Download the latest devtodev SDK from the repository
2. Add DTDAnalytics.xcframework
to the project (check Do Not Embed)
The DTDMessaging plugin will not work without the DTDAnalytics main analytics plugin.
3.Add DTDMessaging.xcframework to the project (check Do Not Embed)
4. In the Xcode project settings, open the tab, and add: "Push Notifications" and "Background Modes" respectively
5. In the "Background Modes" section, enable "Remote notifications"
6. Add initialization to didFinishLaunchingWithOptions
method:
7. To handle SDK delegate methods, you need to add the implementation of the DTDMessagingDelegate
protocol
The DTDMessaging
module provides support for notifications with attachments. These notifications are available since iOS 10. Attachments support images, animated gifs and videos. To use this function, you will need to create a “Notification Service Extension“, for this create a new target in your application settings:
Open Xcode (File -> New -> Target). Select Notification Service Extension.
The next step is to modify the Notification Extension
class as follows:
Delete all auto-generated code.
Inherit Notification Extension
class from DTDMediaAttachmentExtension
Example:
DTDMessaging
moduleDTDMessagingDelegate
methodsDisplaying push notifications in Foreground state is available since iOS 10.0.
By default, according to Apple Push Notification Guidelines, the display of push notification in the Foreground state is disabled. In order to set the display method, you must:
Assign delegate for UNUserNotificationCenter
Or pass a parameter in the push notification constructor (_fg = 1
). In this case, the display method will be formed from the Notification settings.
Or delegate the system method userNotificationCenter willPresent notification
. In this case, the display properties will be taken from the developer.
An example of a delegated method implementation:
It is an OptionSet
that is used to pass push notification authorization and set up interactions with users.
The user can change the allowed parameters at any time in the notification settings.
Possible values:
DTDNotificationOptionProvisional
- Provisional push notifications appear in the user's Notification Center, but not on the lock screen. This type of push notification does not have to be explicitly allowed by the user. Start submitting them as soon as the user installs and runs your application. However, the user can also opt in/opt out of notifications, but they will need to do it explicitly.
This setting is used to prevent receiving push notification permission requests at the start, which is intrusive and most users refuse to receive them.
It is also important that when using the DTDNotificationOptionProvisional
setting, the user will be able to subscribe to explicit notifications only from the notification center settings.
DTDMediaAttachmentExtension
To handle the application attitude to displaying push notifications, you need to add a Notifications service Extension. And inherit NotificationService
from DTDMediaAttachmentExtension
To use custom sounds for push notifications, you need to copy the necessary sound files to the Libraries folder of your Xcode project. You can read more about supported formats here.
When creating a push company, it is important to specify the full name of the sound with file extension (for example, sound.wav).
DTDMessaging automatically swizzles notification tracking and APNS-token usage methods by default. If you want to disable the function, add the flag DTDMessagingSwizzlingEnabled
(boolean) in the app’s Info.plist
file and set it to NO (0). However, if you disable notification swizzling, you will need additional integration for accurate analytics:
For sending APNS-token to DTDMessaging:
For sending information about the application:
Note: If you disable automatic notification swizzling, DTDMessagingDelegate
methods will not be called.
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.
Android Push Notifications
Push Notifications on Android are sent with the help of the FCM service.
Register and open the project creation window in Firebase.
Click Add project.
Write the name of your project. At this stage, you can also set your own unique project identifier or use the one that Firebase will generate for you automatically.
After creating the project card, create an Android application by clicking on the Android icon.
Register your android package name.
Download the google-services.json file and use it according to the instructions of firebase.
Add firebase dependencies according to the firebase documentation.
Complete the application registration, you will see the project overview section.
Select your application by clicking on it, you will see a gear on the right side, click on it to go to project settings.
Go to the cloud messages section, make sure that the Firebase Cloud Messaging API (V1) is active (if not, activate it).
Go to the general section and copy the value of the Project ID field and paste it into the devtodev web interface.
The Project ID is also available from the Firebase main screen in the project cards. After setting up the application, the card should look like this:
It should have a Project ID and an android icon.
Next, open the push notifications integration settings panel in the application settings section in devtodev service (App → Settings → Push notifications → Push notifications panel). Push edit button (pencil symbol).
You will need to specify the Firebase Project ID and authorize devtodev to send messages and manage messaging subscriptions for your Firebase application. To authorise the application, you must use Google login and password of a user with sufficient access rights to the project on Firebase. After that click Save button.
The Messaging module is available as an AAR (recommended) and JAR library. The library is available in the MavenCentral and GitHub repository.
1. If you use Gradle for the applications build, add mavenCentral()
into gradle.build file of your application and specify the following relationship in dependencies block:
2. To the app manifest add the following:
3. To add a user icon to your push notification and change its color, add the following strings to the manifest file code:
To add a large user icon to your push notifications, add:
Example:
4. After the DTDAnalytics
initializer, add the DTDMessaging
initializer.
Example:
5. Subscribe a DTDPushListener
to receive information about the DTDMessaging
functioning.
Example:
6. Call the DTDMessaging.startPushService()
method to activate the Messaging module.
When using Android 13 or higher, notifications are disabled by default. The app won’t receive notifications until you request a new permission (POST_NOTIFICATIONS
) and the user grants this permission to your app.
For notifications to work properly, add the following line to the manifest file:
You can check the operation of the POST_NOTIFICATIONS
permission in your app by inserting this example in the code:
If the check results in a negative answer (access is not granted), call this method:
Its execution will call a dialog that in turn will ask the user to opt in:
This code is going to help you get the user’s decision:
Note. In SDK ver. 2.1.5 or higher, if the permission is not granted, you will see this message in the log from DTDMessaging: “Notifications don’t work. Permission android.permission.POST_NOTIFICATIONS is not granted”.
DTDMessaging
moduleDTDPushListener
Interface MethodsDTDPushMessage
).DTDActionButton
)In order to work with push notifications, you need to integrate the messaging module. You can do it by using one of the two methods: with the help of the Unity Package Manager (recommended) or by manually importing the unitypackage.
If you integrated the devtodev package manually, then you need to delete the Assets/DevToDev and Plugins/DevToDev folders.
In the Package Manager (Window → Package Manager), click + in the top left corner and select Add package from git URL.
Copy the repository URL https://github.com/devtodev-analytics/package_Messaging.git to the input box and click Add.
Wait for the Unity Package Manager to download the package and all the necessary dependencies.
If you use Android, allow dependencies in Assets → External Dependency Manager → Android Resolver → Resolve.
You can pick a specific SDK version by adding # and a version number at the end of the URL, for example: https://github.com/devtodev-analytics/package_Messaging.git#v3.3.2
Download the latest version of devtodev package from the repository: https://github.com/devtodev-analytics/Unity-sdk-3.0/releases/latest
Import DTDAnalytics.unitypackage to your project
Import DTDMessaging.unitypackage to your project
If you use Android, allow dependencies in Assets → External Dependency Manager → Android Resolver → Resolve.
iOS Integration
You use Member Center to generate a push notification client SSL certificate that allows your notification server to connect to the APNs. Each App ID is required to have its own client SSL certificate. The client SSL certificate Member Center generates is a universal certificate that allows your app to connect to both the development and production environments.
Only a team agent or admin can generate Apple Push Notification service SSL certificates.
To generate a universal client SSL certificate
In Certificates, Identifiers & Profiles, select Certificates.
Click the Add button (+)
Under Production, select the “Apple Push Notification service SSL (Sandbox & Production)” checkbox, and click Continue.
Choose an App ID from the App ID pop-up menu, and click Continue. Choose the explicit App ID that matches your bundle ID.
Create a certificate request on your Mac.
Click Choose File.
In the dialog that appears, select the certificate request file (with a .certSigningRequest extension), and click Choose File.
Click Generate.
Click Download.
Open "Keychain access" application
If the certificate hasn't been added to keychain access yet, choose "File" → "Import". Find the certificate file (CER-file) provided by Apple
Choose "Keys" section in "Keychain access" application
Choose a personal key associated with your iPhone developer certificate. Personal key is identified by open certificate associated with it "iPhone developer: ". Choose "File" → Export objects. Save key as .p12
You'll be suggested to create a password which is used when you need to import the key to another computer
Upload the .p12-file into Integration section of application settings panel (Settings -> Push Notifications):
1. For the Messaging module to function you need the basic Analytics package. Before the notification initialization, you need to initialize the SDK. More about it you can read here: Unity Integration.
2. After the DTDAnalytics initialization block call the StartNotificationService
method to activate the Messaging module:
You can listen to basic notification module events. To do this, create a class that implements the IDTDPushListener
interface and pass it to the DTDMessaging.IOS.SetPushListener
method.
Example:
You can specify the necessary display options using the DTDMessaging.IOS.SetNotificationOptions
method.
Example:
A complete example of the notification module initialization:
It is an OptionSet used for push notification authorization and configuration interaction with users.
Attention: The user can change the allowed parameters in the notification settings at any time.
Possible values:
DTDNotificationOptionBadge
- an option for displaying a badge on the application icon
DTDNotificationOptionSound
- an option for playing sound
DTDNotificationOptionAlert
- an option for displaying an alert
DTDNotificationOptionCarPlay
- an option for showing a push notification in CarPlay DTDNotificationOptionCriticalAlert
- an option for playing sound for critical alerts regardless of whether “do not disturb” is on or not. (Critical alerts require special permission from Apple). Available from iOS 12.0 onwards
DTDNotificationOptionProvidesSettings
- an option for indicating that the system should show a notification settings button in the application. Available from iOS 12.0 onwards
DTDNotificationOptionProvisional
- an option for sending provisional notifications to the Notification Center without interrupting functioning processes. Available from iOS 12.0 onwards
DTDNotificationOptionAnnunciation
- an option for Siri to automatically read messages through AirPods. Available from iOS 13.0 onwards
Attention: DTDNotificationOptionProvisional
- 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 DTDNotificationOptionProvisional
setting, the user needs to go to Notification Center settings to allow explicit notifications.
After the build, open the signing and capabilities tab in the XCode project settings and add "Push Notifications" and "Background Modes" (tick the box against Remote notifications).
The framework provides support for iOS 10+ notification attachments, such as images, animated gifs, and video. In order to take advantage of this functionality, you will need to create a notification service extension alongside your main application. Create a new iOS target in Xcode (File -> New -> Target) and select the Notification Service Extension type. In the Member Center, a Push Notifications service will appear as Configurable (not Enabled) until you create a client SSL certificate.
The framework supports notification attachments: images, audio, and video. To enable the functionality, you need to complete several steps:
Create a new iOS target in Xcode (File -> New -> Target) and select the Notification Service Extension
Set language to ‘Swift’
In the next window, click ‘Activate’
In the ‘Build Settings’ tap, change 'Architectures’ to ‘Standard Architecture (arm64, armv7)
Open the ‘Frameworks’ folder in your project, find the ‘DTDMessagingUnity’ framework and tick the box of your target in the ‘Target Membership’ section
In the NotificationService class (in the folder named after your target), replace the code with the following:
To use custom sounds for push notifications, you need to copy the necessary sound files to the Libraries folder of your Xcode project. You can read more about supported formats here.
When creating a push company, it is important to specify the full name of the sound with file extension (for example, sound.wav).
The DevToDev.Messaging
package necessary for notifications is available in the NuGet
package manager.
Package Manager UI
Find the DevToDev.Messaging
package using the package manager search engine and click Install. The latest version of the package is recommended.
To integrate WNS, you need to get the Package SID and Application Secret Key from the Microsoft Partner Center and specify them in the devtodev push notification settings (Project -> Settings-> Push notifications):
For the correct package functioning, add handlers invoke to the Windows.UI.Xaml.Application
class implementation.
Besides, in the UI editor of the Package.appxmanifest file do the following:
Add Background Tasks to the Declarations tab and mark it as System Event. After that enter DevToDev.Background.ToastNotificationBackgroundTask
to the Entry Point field.
Add Background Tasks to the Declarations tab and mark it as Push Notification. After that enter DevToDev.Background.RawNotificationBackgroundTask
to the Entry Point field.
For the DevToDev.Messaging
package functioning you need to have the main DevToDev.Analytics
package installed. Initialize the SDK before initializing messages. You can read about it in more detail in the SDK initialization section.
After the SDK has been initialized you can move to initializing messages. To do this, call the method:
It is possible to listen to events from the DevToDev.Messaging
package:
1. Push Token - a string that allows to identify the client on a remote server for sending him customized notifications. For listening the unique Push Token ID issue event, it is necessary to be subscribed to the event:
2. To track the errors related to the unique Push Token ID issue, it is necessary to be subscribed to the event:
Where error is a string value containing information about the error.
3. To handle incoming message data, it is necessary to be subscribed to the following event:
Where messageData
belongs to the IDictionary<string, string>
type and contains data sent from the server together with the message.
4. To handle notification activation events, it is necessary to be subscribed to the event:
Where messageAction
is DevToDev.Messaging.DTDMessageAction
class instance:
Call the method to turn notifications off:
Android Integration
Push Notifications on Android are sent with the help of the FCM service.
How to create a project in Firebase and integrate Firebase Services into your application, you can find in Firebase documentation.
Next, you need to specify the FCM Server key in the push notifications integration settings panel in the application settings section in devtodev service (App → Settings → Push notifications → Push notifications panel)
To get the FCM Server key, go to the Project Settings of your Android project in the Firebase Console and copy the Server key from the Cloud Messaging tab.
Download google-services.json and put it to Assets folder.
1. For the Messaging module to function you need the basic Analytics package. Before the notification initialization, you need to initialize the SDK. More about it you can read here: Unity Integration.
2. After the DTDAnalytics initialization block add:
3. To activate the Messaging module, call :
Optional:
You can listen to basic notification module events. To do this, create a class that implements the IDTDPushListener
interface and pass it to the DTDMessaging.Android.SetPushListener
method.
Example of the class:
Full example of notification module initialization:
To set a custom sound, icon and its colour in a push notification, copy icons and sounds files in the Assets/Plugins/Android/res/
folder and add the following strings to the manifest file code:
To set a large user icon in the push notification, add:
Delete the \Assets\Plugins\Android\res
folder (together with the .meta
file) - it will cause an error during assembly.
Create a new folder in a separate folder outside of the project.
In the new folder, create AndroidManifest.xml
with the following content (replace company
and package
with you own names)
Create a res folder in the same folder.
Add your resources to the res folder while keeping the folder structure intact (drawable, xml, raw, etc.). An example of the resulting structure:
Run the following code in the in the command line/terminal:
Place the resulting aar file to the \Assets\Plugins\Android\ (edited)
folder
Add the following strings to the project’s Android manifest file ( \Assets\Plugins\Android\AndroidManifest.xml
):
DTDPushMessage
). Main class propertiesDTDActionButton
)Member | Type | Description |
---|---|---|
Member | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Methodes | Description |
---|---|
Delegate method | Description |
---|---|
Property | Description |
---|---|
Property | Description |
---|---|
Method | Description |
---|---|
Property | Description |
---|---|
Property | Description |
---|---|
Object
Description
DTDMessaging
The main object for push notification initialization.
DTDMessaging.initialize(Context context)
The push notification initialization method.
DTDMessaging.startPushService()
The push notification activation method. It passes the isAllowed
current state.
DTDMessaging.pushNotificationsAllowed
= true or false
A property responsible for the activation/deactivation of push notifications.
Functions as a getter (describes the current state) and a setter (sets the current state).
When the state transitions, it sends a pt with isAllowed
(true or false) status to the server.
The isAllowed
flag status is stored in the SDK.
DTDMessaging.setIntent(Intent intent)
A method of passing a user intent to the SDK using PushMessage.
Written in the manifest file
<meta-data android:name="com.devtodev.push.default_small_icon" android:resource="@drawable/smallIcon" />
Sets a small custom user icon.
Written in the manifest file
<meta-data android:name="com.devtodev.default_small_icon_color" android:resource="@color/colorPrimary" />
Sets a color of the small custom user icon.
Written in the manifest file
<meta-data android:name="com.devtodev.push.default_large_icon" android:resource="@mipmap/largeIcon" />
Sets a large custom user icon.
DTDMessaging.getToken()
Returns a push notification registration token (firebaseToken
).
DTDMessaging.processPushNotification(Context context, RemoteMessage remoteMessage)
Used to pass the push notification to the FirebaseMessagingService if it was implemented by the client but not by the SDK.
DTDMessaging.setPushListener(DTDPushListener pushListener)
(DTDPushListener pushListener
) - sets a listener for push notification event trapping.
DTDPushListener Interface Methods
Description
onPushServiceRegistrationSuccessful(String deviceId)
Returns a push notification registration token (firebaseToken
).
onPushServiceRegistrationFailed(String error)
Returns errors during push notification registration.
onPushNotificationReceived(Map<String, String> message)
Returns a directory with data for improving your push notifications.
onPushNotificationOpened(DTDPushMessage pushMessage, @Nullable DTDActionButton actionButton)
Returns pushMessage
and actionButton
if they were tapped.
Property
Type
Description
getData()
Map<String, String>
Complete information sent with the use of a remote push notification.
systemId
Int
The notification ID used in the devtodev system.
getTitle(context:Context)
String?
Returns the selected message title or app name if the former is unavailable.
body
String?
The text body.
group
String?
A group of messages.
getSound(context: Context)
Uri?
Returns the storage path of an audio file.
getSoundName()
String?
The notification sound name.
tag
String?
The notification tag.
color
String?
The notification color.
bigPicture
String?
The notification banner if specified.
actionType
DTDActionType
The property that returns an enum’s DTDActionType value.
Possible values:
Url - an external link opening
Share - content sharing
Deeplink - an in-app link opening
actionString
String?
The property that returns an optional action ID.
getIcon(context: Context, userIcon: Int)
Int
The icon resource identifier specified by the user (if specified).
largeIcon
String?
The large notification icon name.
actions
List<DTDActionButton>
The list of action buttons used in the push notification.
isApiSource
Boolean
Specifies whether the push notification was sent using the devtodev API.
Property
Type
Description
Id
String?
The property that returns the tapped button ID.
actionString
String?
The property that returns the optional action ID.
actionType
DTDActionType
The property that returns an enum’s DTDActionType
value.
Possible values:
App - a default value
Url - an external link opening
Share - content sharing
Deeplink - an in-app link opening
icon
String?
The property that returns the button’s icon name.
isBackground
Boolean
The button-click app open mode.
text
String?
The property that returns the text of the tapped button.
Object
Type
Description
startPushService
Method responsible for activating push notifications:
Requests permission from the user to receive Push Notifications
Sends a pushToken and the current state isAllowed
apnsToken
Data?
Getter giving the current pushToken, represented by a Data
apnsTokenString
String?
Getter giving the current pushToken, represented by a String
delegate
DTDMessagingDelegate?
Property for assigning a delegate to handle events from the SDK
pushNotificationsOptions
DTDNotificationOptions
Configuring the display of Push Notifications, is an OptionSet
, is set by the developer to select the method for notifying the user. May be changed by the end user.
By default it has the following value: [.DTDNotificationOptionBadge, .DTDNotificationOptionSound, .DTDNotificationOptionAlert]
Delegate method
Description
didFailToRegisterForRemoteNotifications
(with error:
Error
)
The method is called when an error occurs at the time of receiving a pushToken, represented by the Error
base class.
didOpenRemoteNotification
(with message:
DTDMessage
, and buttonClicked:
DTDActionButton?
)
The method is called when a remote push notification is opened by an end user. A DTDMessage
object and an optional DTDActionButton
object are passed.
didReceiveForegroundNotification
(with message:
DTDMessage
)
The method is called when a remote push notification is received when the application is in the Foreground state. The DTDMessage
object is passed.
didReceiveInvisibleNotification
(with message:
DTDMessage
)
The method is called when an invisible remote push notification is received. The DTDMessage
object is passed.
didRegisterForRemoteNotifications
(with deviceToken:
Data
)
The method is called in case the pushToken
successfully arrives; represented by a Data.
Property
Type
Description
payload
[AnyHashable:Any]
Full information sent using remote push notification.
actionType
DTDActionType
Property returning the enum DTDActionType value. Possible values:
App
- default value
Url
- open an external link
Share
- share content
Deeplink
- open a link inside the application
actionString
String?
Property returning an optional action identifier.
badge
Int
The value that is passed to display a badge on the application icon.
category
String?
Property returning an optional identifier of a push notification category
Property
Type
Description
actionType
DTDActionType
Property returning the enum DTDActionType value. Possible values:
App
- default value
Url
- open an external link
Share
- share content
Deeplink
- open a link inside the application
actionString
String?
Property returning an optional action identifier.
buttonId
String
Property returning the identifier of the pressed button.
text
String
Property returning the text of the pressed button.
Value
Description
DTDNotificationOptionBadge
display a badge on the application icon
DTDNotificationOptionSound
play sound
DTDNotificationOptionAlert
display an alert
DTDNotificationOptionCarPlay
display push notification in CarPlay
DTDNotificationOptionCriticalAlert
play sound for critical notifications regardless of the “Do Not Disturb” setting (Critical alerts require special permission from Apple.) Available since iOS 12.0
DTDNotificationOptionProvidesSettings
an option specifying that the system should display a button for notification settings in the application. Available since iOS 12.0
DTDNotificationOptionProvisional
pre-send notifications to the Action Center without interrupting work. Available since iOS 12.0
DTDNotificationOptionAnnouncement
for Siri to automatically read messages through AirPods. Available since iOS 13.0
void DTDMessaging.IOS.StartPushService()
The method responsible for push notification activation:
Requests user permission to receive push notifications
Sends push token and current state isAllowed
void DTDMessaging.IOS.GetToken(Action<string> onGetToken)
The method that returns current push token to onGetToken
callback
DTDMessaging.IOS.SetPushListener(IDTDPushListener listener)
The method for assigning a push notification event listener
void DTDMessaging.IOS.PushNotificationsOptions(uint options)
options is responsible for setting up the display of Push Notifications. It is set by the developer to select the method of notifying the user. It can be changed by the end-user.
By default, it has the value:
[.DTDNotificationOptionBadge, .DTDNotificationOptionSound, .DTDNotificationOptionAlert]
void DTDMessaging.IOS.PushIsAllowed (bool isAllowed )
The method is responsible for enabling / disabling the ability to send a push notification to the user from devtodev.
void DTDMessaging.IOS.GetPushState(Action<bool> onGetPushState)
The method that returns the push module state to onGetPushState
callback
void OnPushServiceRegistrationSuccessful (string deviceId);
The method is called if a push token is successfully received, represented by a string.
void OnPushServiceRegistrationFailed (string error);
The method is called if at the time of receiving a pushToken errors occur. It passes the text of the error that occurred
void OnInvisibleNotificationReceived (DTDPushMessage message);
The method is called when an invisible remote push notification is received. The DTDPushMessage
object is passed
void OnPushNotificationReceived (DTDPushMessage message);
The method is called when a remote push notification is received while the application runs in the Foreground state. The DTDPushMessage
object is passed.
void OnPushNotificationOpened (DTDPushMessage pushMessage, DTDActionButton actionButton);
The method is called when the end-user opens a remote push notification. The DTDPushMessage
object and the optional DTDActionButton
object are passed.
IDictionary<string,string> GetData():
Complete information passed with the push notification.
DTDActionType ActionType:
The property that returns the value of enum’s DTDActionType
.
Possible values:
App
- app open
Url
- external link open
Share
- share content
Deeplink
- open a link that leads straight to a specific in-app location
string ActionString
The property that returns an optional action identifier
IDictionary<string,string> AdditionalData()
Additional data sent to push notification
DTDActionType ActionType
The property that returns the value of enum’s DTDActionType
.
Possible values:
App
- app open
Url
- external link open
Share
- share content
Deeplink
- open a link that leads straight to a specific in-app location
string ActionString
The property that returns an optional action identifier
string ButtonId
The property that returns the ID of the clicked button
string ButtonText
The property that returns the text of the clicked button
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.
void DTDMessaging.Android.Initialize()
The push notification initialization method
void DTDMessaging.Android.StartPushService()
The push notification activation method. It passes the isAllowed
current state
void DTDMessaging.Android.PushIsAllowed (bool isAllowed)
A property responsible for the activation/deactivation of push notifications.When the state transitions, it sends a pt with isAllowed
(true or false) status to the server.
The isAllowed
flag status is stored in the SDK.
void DTDMessaging.Android.GetPushState(Action<bool?> onGetPushState)
The method that returns the push module state to onGetPushState
callback. If getting the current state is impossible, it returns null
void DTDMessaging.Android.GetToken(Action<string> onGetToken)
The method that returns push registration token to onGetToken callback
void DTDMessaging.Android.ProcessPushNotification (IDictionary<string, string> firebaseMessaging)
Used to pass the push notification to the FirebaseMessagingService
if it was implemented by the client but not by the SDK
void DTDMessaging.SetPushListener (IDTDPushListener pushListener)
It sets a listener for push notification event trapping
IDictionary<string,string> GetData():
Complete information passed with the push notification.
DTDActionType ActionType:
The property that returns the value of enum’s DTDActionType
.
Possible values:
App - app open
Url - external link open
Share - share content
Deeplink - an in-app link opening
string ActionString
The property that returns an optional action identifier
IDictionary<string,string> AdditionalData()
Additional data sent to push notification
DTDActionType ActionType
The property that returns the value of enum’s DTDActionType
.
Possible values:
App - app open
Url - external link open
Share - share content
Deeplink - an in-app link opening
string ActionString
Property that returns an optional action identifier
string ButtonId
Property that returns the ID of the clicked button
string ButtonText
Property that returns the text of the clicked button
string ButtonIcon
Property that returns the button icon name
bool IsBackground
The button-click app open mode