[英]WP7 Push notifications not working after app has been published
我正在为手机应用程序使用吐司通知。 当该应用程序首次在某人的手机上启动时,它将获得推送通知URL,然后将其存储在我们的数据库中,以便我们向用户发送通知。
在测试中,同时使用仿真器和在我的HTC WP7上进行测试,发现并上传了通知。
现在,应用程序已在商店中,通知URL作为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);
}
}
}
实际上,我也得到了null url,但在我这边,它的WNS在一段时间后没有响应,它将正常工作。
而且我认为波纹管链接可能会帮助您
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.