Windows phone 8 Windows Phone 8推送服务
我正在尝试为我的一个windows phone应用程序运行推送通知 基本上,我复制粘贴了microsoft msdn页面的示例代码并对其进行了修改, 更新我的Web服务,而不是将推送uri打印到控制台 然而,它不工作-即使与未修改的例子 每当我尝试打开推送通道时,我都会收到信息,即推送通道已经存在,但其推送uri为空 我删除了所有评论,但添加了一些信息 提取我的应用程序构造函数:Windows phone 8 Windows Phone 8推送服务,windows-phone-8,push-notification,Windows Phone 8,Push Notification,我正在尝试为我的一个windows phone应用程序运行推送通知 基本上,我复制粘贴了microsoft msdn页面的示例代码并对其进行了修改, 更新我的Web服务,而不是将推送uri打印到控制台 然而,它不工作-即使与未修改的例子 每当我尝试打开推送通道时,我都会收到信息,即推送通道已经存在,但其推送uri为空 我删除了所有评论,但添加了一些信息 提取我的应用程序构造函数: string channelName = "S0meRandomString.";
string channelName = "S0meRandomString.";
InitializeComponent();
pushChannel = HttpNotificationChannel.Find(channelName);
if (pushChannel == null)
{
pushChannel = new HttpNotificationChannel(channelName);
}
pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated);
pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred);
//Without ConnectionStatus check, an Exception is thrown, stating that the channel is already open
if (pushChannel.ConnectionStatus == ChannelConnectionStatus.Disconnected)
{
pushChannel.Open();
}
if (pushChannel.ChannelUri != null)
{
//this part is basically never executed, because ChannelUri is ALWAYS null.
//EVEN if ConnectionStatus says Connected...
WebClient wc = new WebClient();
String uriPush = "http://my.domain.tld/app/updatePushChannel.php?device_id=" + Configuration.Instance.GetDeviceID() + "&channel_uri=" + HttpUtility.UrlEncode(pushChannel.ChannelUri.ToString());
wc.DownloadStringAsync(new Uri(uriPush)); //fire and forget for debuging.
if (!pushChannel.IsShellToastBound)
{
pushChannel.BindToShellToast();
}
}
我读了很多关于微软推送服务服务器的问题。。。然而,大多数帖子都有2-4年的历史,我认为这项服务的启动问题现在应该解决了