C# 4.0 Windows Phone互动程序推送通知未收到?

C# 4.0 Windows Phone互动程序推送通知未收到?,c#-4.0,windows-phone-8,push-notification,mpns,live-tile,C# 4.0,Windows Phone 8,Push Notification,Mpns,Live Tile,您好,我正在为Windows Phone 8开发。我需要使用PHP发送和接收瓷砖推送通知。在我的设备上未收到磁贴推送通知。我得到下面给出的错误。有人能告诉我为什么我要面对这个问题吗 错误: HTTP/1.1 200 OK缓存控制:专用服务器:Microsoft IIS/7.5 X-DeviceConnectionStatus:已连接的X-NotificationStatus:已抑制的X-SubscriptionStatus:活动X-MessageID:00000000-0000-0000-000

您好,我正在为Windows Phone 8开发。我需要使用PHP发送和接收瓷砖推送通知。在我的设备上未收到磁贴推送通知。我得到下面给出的错误。有人能告诉我为什么我要面对这个问题吗

错误:

HTTP/1.1 200 OK缓存控制:专用服务器:Microsoft IIS/7.5 X-DeviceConnectionStatus:已连接的X-NotificationStatus:已抑制的X-SubscriptionStatus:活动X-MessageID:00000000-0000-0000-0000-00000000活动ID:d4a926a3-345c-432f-9a96-2f9c62ce8013 X-Server:DB3MPNSM036 X-ASPNNET-Version:4.0.30319 X-Powered-By:ASP.NET日期:Tue,2013年10月1日09:08:33 GMT内容长度:0

我使用的代码如下:

 HttpNotificationChannel pushChannel;

        // The name of our push channel.
        string channelName = "TileSampleChannel";
        InitializeComponent();
        // Try to find the push channel.
        pushChannel = HttpNotificationChannel.Find(channelName);

        // If the channel was not found, then create a new connection to the push service.
        if (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);

            pushChannel.Open();

            // Bind this new channel for Tile events.
            pushChannel.BindToShellTile();


        }
        else
        {
            // The channel was already open, so just register for all the events.
            pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated);
            pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred);

            // Display the URI for testing purposes. Normally, the URI would be passed back to your web service at this point.
            System.Diagnostics.Debug.WriteLine(pushChannel.ChannelUri.ToString());
           // MessageBox.Show(String.Format("Channel Uri is {0}",pushChannel.ChannelUri.ToString()));

        }





 void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
    {

        Dispatcher.BeginInvoke(() =>
        {
            // Display the new URI for testing purposes. Normally, the URI would be passed back to your web service at this point.
            System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
           // MessageBox.Show(String.Format("Channel Uri is {0}", e.ChannelUri.ToString()));

        });
    }
    void PushChannel_ErrorOccurred(object sender, NotificationChannelErrorEventArgs e)
    {
        // Error handling logic for your particular application would be here.
        Dispatcher.BeginInvoke(() => MessageBox.Show(String.Format("A push notification {0} error occurred.  {1} ({2}) {3}",e.ErrorType, e.Message, e.ErrorCode, e.ErrorAdditionalData)) );
    }  
HttpNotificationChannel推送通道;
//我们推送频道的名称。
字符串channelName=“TileSampleChannel”;
初始化组件();
//试着找到推送通道。
pushChannel=HttpNotificationChannel.Find(channelName);
//如果未找到通道,则创建到推送服务的新连接。
if(pushChannel==null)
{
pushChannel=新的HttpNotificationChannel(通道名称);
//在尝试打开通道之前注册所有事件。
pushChannel.ChannelUriUpdated+=新事件处理程序(pushChannel\u ChannelUriUpdated);
pushChannel.ErrorOccursed+=新的事件处理程序(pushChannel\u ErrorOccursed);
pushChannel.Open();
//为平铺事件绑定此新通道。
pushChannel.BindToShellTile();
}
其他的
{
//频道已经打开,所以只需注册所有事件。
pushChannel.ChannelUriUpdated+=新事件处理程序(pushChannel\u ChannelUriUpdated);
pushChannel.ErrorOccursed+=新的事件处理程序(pushChannel\u ErrorOccursed);
//出于测试目的显示URI。通常,URI会在此时传递回web服务。
System.Diagnostics.Debug.WriteLine(pushChannel.ChannelUri.ToString());
//Show(String.Format(“通道Uri为{0}”,pushChannel.ChannelUri.ToString());
}
void PushChannel\u ChannelUriUpdated(对象发送方,NotificationChannelUriEventArgs e)
{
Dispatcher.BeginInvoke(()=>
{
//出于测试目的显示新的URI。通常,URI会在此时传递回web服务。
System.Diagnostics.Debug.WriteLine(例如ChannelUri.ToString());
//Show(String.Format(“通道Uri为{0}”,e.ChannelUri.ToString());
});
}
出现无效PushChannel_错误(对象发送方,NotificationChannelErrorEventArgs e)
{
//这里将显示特定应用程序的错误处理逻辑。
Dispatcher.BeginInvoke(()=>MessageBox.Show(String.Format(“发生推送通知{0}错误。{1}({2}){3}”、e.ErrorType、e.Message、e.ErrorCode、e.ErrorAdditionalData));
}  
以下是对您得到的响应的评论(200 OK、抑制、连接、激活):

推送通知已被推送通知服务接收并丢弃。如果在客户端应用程序中调用BindToSellTile或BindToSellToast未启用通知类型,如果在应用程序不在前台时发送原始通知,或者如果发送的平铺通知中没有锁定应用程序启动的平铺,则会出现抑制状态

我看到您确实调用了
BindToShellTile
,并且您没有发送原始通知,因此最后一个选项可能适用-
发送了一个Tile通知,但应用程序没有固定到启动位置的Tile