App Center Push

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 will need a Windows Developer account to send push notifications to your UWP app. You can register a 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 or Xamarin Studio

  • 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 for 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 need to install the packages in each of the projects: the portable, Android, iOS and UWP ones.

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.

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); after AppCenter.Start in OnLaunched method.

protected override void OnLaunched(LaunchActivatedEventArgs e)
    AppCenter.Start("{Your App Secret}", typeof(Analytics), typeof(Push));

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
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

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 WNS 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();