简体   繁体   English

应用发布后WP7推送通知不起作用

[英]WP7 Push notifications not working after app has been published

I'm using toast notifications for my phone app. 我正在为手机应用程序使用吐司通知。 When the app is first started on someones phone it will get the push notification URL and then store it in our database so we can send notifications down to the user. 当该应用程序首次在某人的手机上启动时,它将获得推送通知URL,然后将其存储在我们的数据库中,以便我们向用户发送通知。

In testing, using both the emulator and testing on my HTC WP7 the notification was found and uploaded. 在测试中,同时使用仿真器和在我的HTC WP7上进行测试,发现并上传了通知。

Now the application is in the store, notification URL's are coming to the server as NULL. 现在,应用程序已在商店中,通知UR​​L作为NULL进入服务器。 In the app dashboard I'm getting the following: 在应用仪表板中,我得到以下信息:

Missing certificate for authenticated push notifications: Certificate for authenticated push notifications 身份验证的推送通知的证书丢失:身份验证的推送通知的证书

Would this be causing the issue? 这会引起问题吗? If so, how do I go about getting this certificate? 如果是这样,我该如何获得该证书? I can't find anything relating to this anywhere. 我在任何地方都找不到与此有关的东西。

Below is a code snippet, which worked in testing but since publishing to the store is always returning NULL: 下面是一个代码段,该代码段在测试中起作用,但是由于发布到商店始终返回NULL:

private void BindChannel()
    {
        channel = HttpNotificationChannel.Find(channelName);

        if (channel == null || channel.ChannelUri == null)
        {
            if (channel != null) DisposeChannel();

            channel = new HttpNotificationChannel(channelName);
            channel.ChannelUriUpdated += channel_ChannelUriUpdated;
            channel.Open();
        }
        else
        {
            StorageSettings.StoreSetting("NotifyURL", channel.ChannelUri.AbsoluteUri); 
        }

        SubscribeToChannelEvents();

        if (!channel.IsShellTileBound) channel.BindToShellTile();
        if (!channel.IsShellToastBound) channel.BindToShellToast();

        string notificationUri = string.Empty;

        if (StorageSettings.TryGetSetting<string>("NotifyURL", out notificationUri))
        {
            if (notificationUri != channel.ChannelUri.AbsoluteUri)
            {
                StorageSettings.StoreSetting("NotifyURL", channel.ChannelUri.AbsoluteUri);
            }
        }
        else
        {
            if (channel.ChannelUri != null)
            {
                StorageSettings.StoreSetting("NotifyURL", channel.ChannelUri.AbsoluteUri);
            }
        }

    }

Actully i am getting also null url but in my side its WNS not responding after some time it will working fine. 实际上,我也得到了null url,但在我这边,它的WNS在一段时间后没有响应,它将正常工作。

And I think bellow link may be help you 而且我认为波纹管链接可能会帮助您

Overview of pushnotification 推送通知概述

How to authenticate with the Windows Push Notification Service (WNS) (Windows) 如何使用Windows推送通知服务(WNS)进行身份验证(Windows)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM