[英]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.