Connecting the AppMetrica Push SDK

You can use the Windows SDK for mobile and desktop applications (developed on the UWP 10 platform).

Before using the AppMetrica Push SDK, you need to enable and initialize the AppMetrica SDK version 3.2.0 or higher.

Step 1. Download the AppMetrica Push SDK library.

Step 2. Initialize the library in the application by adding to the App.xaml.cs file the Activate() method call. Call it in the OnLaunched method implementation of the App.xaml.cs or in the MainPage constructor of your application:

...
YandexMetricaPush.Activate(AppSid);
...
AppSid — String with the Windows Store security identifier. It consists of the ms-app:// prefix and the identifier value. For example, ms-app://s-1-15-2-3792079137-3272192291-.....

Step 3. Configure handling the opening of push notifications. You can use either Windows Push Notification Services or Microsoft Push Notification Service for working with push notifications in the app. Depending on which service is used, use one of the following methods to configure handling push notifications:

Windows Push Notification Services (WNS)

In the OnLaunched method for the Application class, add the ProcessApplicationLaunch method call for the YandexMetricaPush class:

protected override void OnLaunched(LaunchActivatedEventArgs e) {
    YandexMetricaPush.ProcessApplicationLaunch(e);
    ...
}
Microsoft Push Notification Service (MPNS)

In the OnNavigatedTo method for the Page class (the start page specified in the push notification parameters), add the ProcessApplicationLaunch method call for the YandexMetricaPush class:

protected override void OnNavigatedTo(NavigationEventArgs e) {
    YandexMetricaPush.ProcessApplicationLaunch(e);
    ...
}