Intercept ScheduledToastNotification RRS feed

  • Question

  • http://msdn.microsoft.com/en-us/library/windows/apps/hh465391.aspx

    This page indicates that toast notifications can be intercepted using the `PushNotificationReceived` event.  So I put this into my App.xaml.cpp

    .then([this](PushNotificationChannel ^channel) {
    	channel->PushNotificationReceived += ref new TypedEventHandler<PushNotificationChannel ^, PushNotificationReceivedEventArgs ^>
    (this, &App::OnPushNotification);

    I then schedule a notification like so


    However, the toast shows even when the app is in the foreground (the event handler is never called).  Why is this?  Perhaps the channel is only for remote push notifications?  In that case, is there a similar way to intercept locally scheduled notifications?  Or do I have to remove them when the app is in the foreground, and add them when it goes into the background?

    Friday, July 11, 2014 4:36 AM