LogoLogo
My AppsLive demoNewsArticles
  • Introduction
  • 📌Product updates: 2025
    • 2024
    • 2023
  • Getting Started
    • Registration
    • Adding a space
    • Adding an app to the space
  • Basic Events & Custom Events
  • Integration
    • Expert Tips
      • What to track
      • Payments & Anti-cheat
      • Check your integration
    • Integration of SDK 2.0+
      • SDK Integration
        • Android
        • iOS
        • macOS
        • Windows
        • Web
          • Web SDK Integration
          • Web SDK Releases
        • Unity
        • Unreal Engine
        • Godot Engine
      • Automatic payment tracking
        • App Store
        • Google Play
      • Setting up Events
        • Basic methods
        • Secondary methods
        • User profile
        • Anticheat methods
        • Track sessions
      • Push notifications
        • Android
        • iOS
        • Windows (UWP)
        • Unity
          • Android
          • iOS
          • Windows (UWP/WSA)
        • Unreal Engine
      • A/B testing
        • Description of A/B testing on the SDK side
        • Working with A/B tests in the devtodev interface
        • A/B testing examples
    • Integration of SDK 1.0+ (deprecated)
      • SDK Integration
        • iOS
        • Android
        • Windows 8.1 and 10
        • Web
        • Unity
        • Mac OS
        • Adobe Air
        • UE4
      • Setting up Events
        • Basic methods
        • Secondary methods
        • User profile
        • Anti-cheat Methods
      • Push Notifications
        • IOS
        • Android
        • Windows 8.1 and Windows 10
        • Unity
        • Abode Air
        • UE4
    • Test Devices
    • Server API
      • Data API 2.0
      • Subscription API
      • Push API
        • IOS
        • Android
        • Windows UWP
        • Windows
      • Raw Export
      • Labels API
      • Data API
    • Import historical data via API
    • Data Export
      • Data Export to Cloud Storage (BigQuery / Amazon S3)
  • 3rd Party Sources
    • Attribution Trackers
      • AppsFlyer
      • Adjust
      • Branch.io
      • Kochava
      • Tenjin
      • Tune (MAT)
      • Singular
      • Custom postback API
      • Facebook Ads referral decryption
    • App Marketplace Data
      • App Store Connect Stats
      • App Store Subscriptions
      • Google Play Console Stats
      • Google Play Subscriptions
      • AppGallery Connect Stats
    • Ad revenue
      • AdColony
      • AdMob
      • Facebook
      • MoPub
      • Unity Ads
      • Vungle
      • Ad revenue API
    • Cohort export
  • Reports and Functionality
    • Space-related Reports and Functionality
      • Overview
      • Custom dashboards & Reports
      • SQL
        • SQL tips
        • SQL Query examples
      • Audience overlap
    • Project-related Reports and Functionality
      • Overview
        • Real-Time Dashboard
        • Acquisition reports
        • Engagement reports
        • Monetization reports
        • In-game analysis reports
        • Cohort analysis
      • Reports
      • Push Notifications
        • Android Notifications
        • IOS Notifications
        • Windows Notifications
        • Button Templates
      • Predictions
      • Users & Segments
      • Filters
      • A/B Testing
      • Tuning
      • Settings
  • Metrics and Glossary
    • Ad networks metrics
    • Market Metrics
    • Prediction Metrics
    • SDK Metrics
    • Subscription metrics
  • Space Management
  • User Profile Management
  • Limits
  • Scenarios and Best Practices
    • Analytics use cases
    • Match-3
    • MMORPG Games
    • Hyper-Casual games
    • Social Casino
    • RPG games
    • Farming games
    • Non-gaming app
    • Acquisition Example
  • FAQ
    • Identification
    • Raw Data
    • All about data discrepancies
  • Slack
Powered by GitBook
On this page
  • Push Notifications (UWP)
  • 1. NuGet Installation
  • 2. Credentials
  • 3. Setup
  • 4. Initialization
  • 5. Events
  • 6. Disabling

Was this helpful?

Export as PDF
  1. Integration
  2. Integration of SDK 2.0+
  3. Push notifications

Windows (UWP)

PreviousiOSNextUnity

Last updated 18 days ago

Was this helpful?

Push Notifications (UWP)

The DevToDev.Messaging package necessary for notifications is available in the NuGet package manager.

1. NuGet Installation

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.

2. Credentials

3. Setup

For the correct package functioning, add handlers invoke to the Windows.UI.Xaml.Application class implementation.

sealed partial class App : Application
{
  protected override void OnLaunched(LaunchActivatedEventArgs e)
  {
    // Your code...
    DTDMessaging.HandleActivatedEvent(e);
  }
  
  protected override void OnActivated(IActivatedEventArgs args)
  {
      // Your code...
      DTDMessaging.HandleActivatedEvent(args);
  }
}

Besides, in the UI editor of the Package.appxmanifest file do the following:

  1. Add Background Tasks to the Declarations tab and mark it as System Event. After that enter DevToDev.Background.ToastNotificationBackgroundTask to the Entry Point field.

  2. Add Background Tasks to the Declarations tab and mark it as Push Notification. After that enter DevToDev.Background.RawNotificationBackgroundTask to the Entry Point field.

4. Initialization

After the SDK has been initialized you can move to initializing messages. To do this, call the method:

DTDMessaging.SetMessagingEnabling(true);

5. Events

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:

DTDMessaging.OnTokenReceived += token => { /* Your code... */ };

2. To track the errors related to the unique Push Token ID issue, it is necessary to be subscribed to the event:

DTDMessaging.OnTokenFailed += error => { /* Your code... */ };

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:

DTDMessaging.OnMessageReceived += messageData => { /* Your code... */ };

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:

DTDMessaging.OnMessageActivated += messageAction => { /* Your code with token. */ };

Where messageAction is DevToDev.Messaging.DTDMessageAction class instance:

/// <summary>
/// The class contains information about notification's action.
/// </summary>
public sealed class DTDMessageAction
{
    /// <summary>
    /// Action type.
    /// Can be: Open, Url, Share, DeepLink.
    /// </summary>
    public DTDMessageActionType ActionType { get; }

    /// <summary>
    /// Action string.
    /// </summary>
    public string ActionString { get; }

    /// <summary>
    /// Activated button ID.
    /// </summary>
    public string ButtonId { get; }

    /// <summary>
    /// Activated button's text.
    /// </summary>
    public string ButtonText { get; }

    /// <summary>
    /// Notification data.
    /// </summary>
    public IReadOnlyDictionary<string, string> MessageData { get; }
  }

6. Disabling

Call the method to turn notifications off:

DTDMessaging.SetMessagingEnabling(false);

To integrate WNS, you need to get the Package SID and Application Secret Key from the and specify them in the devtodev push notification settings (Project -> Settings-> Push notifications):

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 .

Microsoft Partner Center
LogoDevToDev.Analytics.Uwp 2.0.1nuget
LogoDevToDev.Messaging.Uwp 2.0.1nuget
SDK initialization section