Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 2.49 KB

dev-center-notifications.md

File metadata and controls

33 lines (21 loc) · 2.49 KB

Dev Center Notifications

Engaging with your customers at the right time and with the right message is key to your success as an app developer. Windows Dev Center provides a data-driven customer engagement platform you can use to send notifications to all of your customers, or targeted to a subset who meet the criteria you've defined in a customer segment.


❗ There is also a version of this document with code samples in VB.NET

The StoreNotificationsService is in charge of configuring the application with the Windows Dev Center notifications service to allow the application to receive push notifications from the Windows Dev Center remote service. The service contains the InitializeAsync() method that sets up the Store Notifications. This feature uses the Store API to configure the notifications.

See the official documentation on how to configure your app for targeted push notifications and how to send notifications to your app's customers.

To handle app activation from a Notification that is sent from Windows Dev Center service will need you to add a similar implementation to that detailed for toast notifications. The key difference is to call ParseArgumentsAndTrackAppLaunch to notify the Windows Dev Center that the app was launched in response to a targeted push notification and to get the original arguments. An example of this is shown below.

protected override async Task HandleInternalAsync(ToastNotificationActivatedEventArgs args)
{
    var toastActivationArgs = args as ToastNotificationActivatedEventArgs;

    StoreServicesEngagementManager engagementManager = StoreServicesEngagementManager.GetDefault();
    string originalArgs = engagementManager.ParseArgumentsAndTrackAppLaunch(toastActivationArgs.Argument);

    //// Use the originalArgs variable to access the original arguments passed to the app.
    NavigationService.Navigate<Views.ActivatedFromStorePage>(originalArgs);

    await Task.CompletedTask;
}

Other useful information about notifications