/// <summary> /// Agent that runs a scheduled task /// </summary> /// <param name="task"> /// The invoked task /// </param> /// <remarks> /// This method is called when a periodic or resource intensive task is invoked /// </remarks> protected override void OnInvoke(ScheduledTask task) { //TODO: Add code to perform your task in background //TODO: https://tech.yandex.com/metrica-mobile-sdk/doc/mobile-sdk-dg/tasks/winphone-quickstart-docpage/--> YandexMetrica.Config.LocationTracking = false; YandexMetrica.Activate("Yours Api Key"); YandexMetrica.ReportEvent("Hello from background!"); YandexMetrica.Snapshot(); NotifyComplete(); }
public void Run(IBackgroundTaskInstance taskInstance) { var deferral = taskInstance.GetDeferral(); YandexMetrica.Config.LocationTracking = false; //TODO: https://tech.yandex.com/metrica-mobile-sdk/doc/mobile-sdk-dg/tasks/winphone-quickstart-docpage/ YandexMetrica.Activate("Yours Api Key"); YandexMetrica.ReportEvent("Hello from background!"); YandexMetrica.Snapshot(); deferral.Complete(); }