---
title: "PUSH not showing when App is open"  
description: "PUSH not showing when App is open"  
author: "Anonymous User"  
published: 2015-04-24  
updated: 2015-04-24  
canonical: https://www.mindstick.com/forum/23133/push-not-showing-when-app-is-open  
category: "windows phone"  
tags: ["c#", ".net", "windows phone"]  
reading_time: 3 minutes  

---

# PUSH not showing when App is open

My [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) receives [push notifications](https://answers.mindstick.com/qa/116274/push-notifications-stop-working-but-in-app-notifications-work) well when the application is closed. But when the [app is running](https://www.mindstick.com/forum/23083/how-to-disable-auto-locking-when-our-windows-phone-app-is-running), I get nothing. This is the same [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) that I have used in [previous](https://yourviews.mindstick.com/view/81421/unlock-2-0-is-just-like-previous-corona-lockdowns) [apps](https://www.mindstick.com/articles/12842/6-apps-for-writers-that-are-actually-worth-downloading) with out any problems, those were on WindowsPhone8 and the new apps are running on WindowsPhone8.1 devices.\
I used this Push Tutorial when I made the original app. I do have the line that says [add](https://www.mindstick.com/forum/12983/add-address-in-textbox-when-page-is-load-and-if-i-search-address-in-textbox-show-in-map-by-javascript) this if you want to receive notifications while the app is open.\
If the 8.1 [update](https://www.mindstick.com/forum/156353/what-is-hummingbird-update) has [done something](https://answers.mindstick.com/qa/36411/have-you-ever-done-something-illegal) to the push notifications that would be good to know. Anything else would also be appreciated.\

```
HttpNotificationChannel pushChannel;string channelName = "PushChannel";pushChannel = HttpNotificationChannel.Find(channelName);//Push Notificationsif (pushChannel == null){    pushChannel = new HttpNotificationChannel(channelName);    //// Register for all the events before attempting to open the channel.    pushChannel.ChannelUriUpdated +=       new EventHandler<NotificationChannelUriEventArgs>(         PushChannel_ChannelUriUpdated);    pushChannel.ErrorOccurred +=       new EventHandler<NotificationChannelErrorEventArgs>(         PushChannel_ErrorOccurred);    // Register for this notification only if you need to receive     // the notifications while your application is running.    pushChannel.ShellToastNotificationReceived +=       new EventHandler<NotificationEventArgs>(         PushChannel_ShellToastNotificationReceived);    pushChannel.Open();    // Bind this new channel for toast events.    pushChannel.BindToShellToast();}else...void PushChannel_ShellToastNotificationReceived(object sender,                                                          NotificationEventArgs e){    string relativeUri = string.Empty;    // Parse out the information that was part of the message.    foreach (string key in e.Collection.Keys)    {        if (string.Compare(        key,        "wp:Param",        System.Globalization.CultureInfo.InvariantCulture,        System.Globalization.CompareOptions.IgnoreCase) == 0)        {            relativeUri = e.Collection[key];        }    }}
```

## Replies

### Reply by Anonymous User

Toasts aren't expected to display when the app is in the foreground. The app is expected to show its own UI, if needed (your snippet doesn't show anything). This is what the ShellToastNotificationReceived event is for: it fires when a toast notification arrives instead of the toast showing up. Can you confirm that ShellToastNotificationReceived isn't raised when you expect the toast? It should be. Can you confirm that it is registered for and received (or not) in the debugger? See msdn.microsoft.com/en-us/library/windows/apps/…\
Before the 8.1 Update, when an open app received a [PUSH](https://www.mindstick.com/interview/33596/what-is-the-difference-between-a-push-and-a-pop), the toast would still show. I just did some testing, and sure enough, the "PushChannel_ShellToastNotificationReceived" event is still being fired, but the toast not showing. I guess this just means I need to handle it different. If you want to turn that into an answer,\


---

Original Source: https://www.mindstick.com/forum/23133/push-not-showing-when-app-is-open

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
