【问题标题】:httpnotificationchannel same ChannelUri from two different apps in emulator来自模拟器中两个不同应用程序的 httpnotificationchannel 相同 ChannelUri
【发布时间】:2013-03-06 20:48:16
【问题描述】:

我是 windows phone 开发的新手,已经开始在 Visual Studio 2012 的模拟器中使用推送通知。我们遇到了一个奇怪的问题,我们在 Visual Studio 中有两个应用程序,当我们启动每个应用程序并调用以下命令时:

  CurrentChannel = HttpNotificationChannel.Find("ChannelName");

  if (CurrentChannel == null)
  {
    CurrentChannel = new HttpNotificationChannel("ChannelName");
    CurrentChannel.Open();
    CurrentChannel.BindToShellTile();
    CurrentChannel.BindToShellToast();
  }

尽管ChannelName 在每个应用程序中不同,但CurrentChannel.ChannelUri 是相同的,因此当我们发送推送通知时,它们只会发送到一个应用程序。

我确信我们遗漏了一些非常明显的东西或误解了它的工作方式,但我们将不胜感激。

【问题讨论】:

    标签: c# push-notification windows-phone mpns


    【解决方案1】:

    我想根据你的代码,你没有得到正确的 Uri。尝试监听 ChannelUriUpdated 事件以获取新的 Uri。

    如果你这样做了,也许可以在真实设备上尝试一下,模拟器并不总是足够受信任。

    并且推送通知通道 URi 对于设备和应用程序组合是独一无二的,以确保您在这两个应用程序中做出了不同的事情。无论如何,这似乎不可能发生。

    【讨论】:

      猜你喜欢
      • 2023-04-01
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多