Connecting the AppMetrica Push SDK

Attention. We discontinued the development of new versions of the AppMetrica Windows 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);
...
Copied to clipboard
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);
    ...
}
Copied to clipboard
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);
    ...
}
Copied to clipboard

If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.