Example #1
0
 private static void PushChannel_PushNotificationReceived(PushNotificationChannel sender, PushNotificationReceivedEventArgs args)
 {
     if (args.NotificationType == PushNotificationType.Raw)
     {
         args.Cancel = true;
         _notificationsPresenter.HandleNotification(args.RawNotification.Content);
     }
     else
     {
         _notificationsPresenter.HandlePlatformNotification(args);
     }
 }
Example #2
0
        public static void HandlePushRelatedBackgroundActivation(BackgroundActivatedEventArgs args, IUniversalWindowsRemoteNotificationsPresenter notificationsPresenter, INotificationsService notificationsService)
        {
            PushServicesExtensions.SetupNotificationsIfNeeded(notificationsService, notificationsPresenter);
            if (args.TaskInstance.Task.Name == PushBackgroundTaskNotificationServiceDecorator.BackgroundTaskName)
            {
                notificationsPresenter.HandleNotification((args.TaskInstance.TriggerDetails as RawNotification).Content);
            }

            if (args.TaskInstance.Task.Name == PushInvalidateRegistrationAppUpdateBackgroundTaskNotificationsServiceDecorator.BackgroundTaskName)
            {
                HandleAppUpdateBackgroundActivation(args, notificationsService);
            }
        }