App Center Push for Universal Windows Platform

App Center Push enables you to send push notifications to users of your app from the App Center portal and relies on Windows Notification Services (WNS) to push notifications to the devices.


A toast is displayed only if the application is in background at the moment the Push is received.

Prerequisite - Register your app for Windows Notification Services (WNS)

Before you can send notification using WNS, your app must be registered with the Windows Store. This will provide you with credentials for your app that App Center will use to authenticate with WNS. These credentials consist of a Package Security Identifier (SID) and an application secret key. To perform this registeration, you need to associate your app with the Windows Store in Visual Studio.

1. Windows Store Association in Visual Studio

  1. In Visual Studio Solution Explorer, right-click the UWP project, click Store -> Associate App with the Store...

    uwp store association

  2. In the wizard, click Next, sign in with your Windows developer account, type a name for your app in Reserve a new app name, then click Reserve.

  3. After the app registration is successfully created, select the new app name, click Next, and then click Associate. This adds the required Windows Store registration information to the application manifest.


You must have a Windows Developer account to send push notifications to your UWP app. You can register a Microsoft developer account if you don't already have one.

2. Get Package SID and Application secret from Application Registration Portal

  1. Navigate to the Microsoft Application Registration Portal, sign-in with your Microsoft account. Click the Windows Store app you associated in the previous step.

    uwp app registration

  2. In the registration page, make a note of the value under Application Secrets and the Package SID, which you will next use to configure your App Center Push backend.

3. Configure Package SID and Security Key in App Center portal

Navigate to your App Center app -> Push, enter Package SID and Security key that you obtained from the Microsoft Application Registration Portal in the previous step, click Apply changes.

Add App Center Push to your app

Please follow the Get started section if you haven't set up and started the SDK in your application.

1. Add the App Center Push package

The App Center SDK is designed with a modular approach – a developer only needs to integrate the modules of the services that they're interested in. It can be integrated using Visual Studio or Package Manager Console.

Visual Studio for Mac

  • Under your project, select Packages, open context menu and click Add packages.
  • Search for App Center, and select App Center Push.
  • Click Add Packages.

Visual Studio on Windows

  • Navigate to the Project > Manage NuGet Packages...
  • Search for App Center, then install Microsoft.AppCenter.Push.

Package Manager Console

  • Type the following command in Package Manager Console:

    PM> Install-Package Microsoft.AppCenter.Push


If you use the App Center SDK in a portable project (such as Xamarin.Forms), you must install the packages in each of the projects: the portable, Android, iOS and UWP ones.


If your Android project does not target the Mono framework version 8.1 or higher, you will not be able to install the package. You can safely bump this version in Options > General > Target framework as this has no impact on minimum API level or target API level fields. If you are using App Center Build, you must make sure Mono version is 5.8 or higher (in Build Config > Build app > More options).

Now that you've integrated App Center Push in your application, it's time to start the SDK and make use of App Center.

2. Start App Center Push service

In order to use App Center, you need to opt in to the module(s) that you want to use, meaning by default no modules are started and you will have to explicitly call each of them when starting the SDK.

Add the following using statement to the top of the file you are referencing Push from:

using Microsoft.AppCenter.Push

Next, add typeof(Push) to your AppCenter.Start() method to start App Center Push service.

AppCenter.Start("{Your App Secret}", typeof(Push));

Make sure you have replaced {Your App Secret} in the code sample above with your app secret.


If your UWP project is part of a Xamarin.Forms application, it is not necessary to add the call to AppCenter.Start() in the UWP portion of the project. The method call can instead be made from the PCL or shared project portion of your Xamarin.Forms application in the OnStart callback.

Intercept push notifications

App Center Push makes it possible to intercept push notifications but there is some setup required to enable this feature in UWP.

Additional setup

Call Push.CheckLaunchedFromNotification(e); at the end of the OnLaunched method in your UWP application source file (not in the portable application file if you use Xamarin.Forms).

protected override void OnLaunched(LaunchActivatedEventArgs e)
    // other code...

    // This should be the last instruction


  • If you use Xamarin.Forms, make sure the AppCenter.start call is made in the OnStart callback of the Xamarin.Forms application class.
  • If you don't use Xamarin.Forms, make sure the AppCenter.start call is made in the application constructor or before Push.CheckLaunchedFromNotification.

Subscribe to the push event

You can subscribe to the Push.PushNotificationReceived event to be notified whenever a push notification is received in the foreground or a background push notification has been clicked by the user.


No toast is shown when the push is received in foreground.


If the push is received in background, the event is NOT triggered at receive time. The event is triggered when you click on the notification.


UWP toasts do NOT expose title and message to the background notification click callback. Title and message are only available in foreground pushes.

The following example demonstrates how to use the push event.

// This should come before AppCenter.Start() is called
// Avoid duplicate event registration:
if (!AppCenter.Configured)
    Push.PushNotificationReceived += (sender, e) =>
        // Add the notification message and title to the message
        var summary =  $"Push notification received:" +
                            $"\n\tNotification title: {e.Title}" +
                            $"\n\tMessage: {e.Message}";
        // If there is custom data associated with the notification,
        // print the entries
        if (e.CustomData != null)
            summary += "\n\tCustom data:\n";
            foreach (var key in e.CustomData.Keys)
                summary += $"\t\t{key} : {e.CustomData[key]}\n";

        // Send the notification summary to debug output

// AppCenter.start after
AppCenter.Start(..., ... ,typeof(Push), ...);

Custom data in your notifications

You can send optional custom data as part of the push payload. The data will be sent in the key-value format. This custom data can be intercepted in the app through Push SDK callback.

There are few reserved keywords that can be set via custom data.

Reserved keywords in Windows platform

  • audio: Add this key when you want the to play a sound. this will modify the audio attribute for toast notifications.
  • image: Add this key when you want to modify the image attribute for tile and toast notifications.

Enable or disable App Center Push at runtime

You can enable and disable App Center Push at runtime. If you disable it, the SDK will stop updating the registration identifier that is used to push notifications, but the existing one will continue to work. In other words, disabling the App Center Push in the SDK will NOT stop your application from receiving push notifications.


To enable App Center Push again, use the same API but pass true as a parameter.


You don't need to await this call to make other API calls (such as IsEnabledAsync) consistent.

Check if App Center Push is enabled

You can also check if App Center Push is enabled or not:

bool isEnabled = await Push.IsEnabledAsync();