设备上的 WNS 错误 0x880403E8 [英] WNS error 0x880403E8 on device

查看:18
本文介绍了设备上的 WNS 错误 0x880403E8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个接收 WNS 通知的 WP8.1 silverlight 应用程序.它在模拟器上运行良好,但在设备 (lumia 640) 上,它在以下 api 调用时崩溃:

I am developing a WP8.1 silverlight app, that receives WNS notification. It works fine on the emulator, but on the device (lumia 640), it crashes at the following api call:

var channel = await Windows.Networking.PushNotifications.PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();

我收到以下错误:

  • _exception {System.Exception: 来自 HRESULT 的异常:0x880403E8在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Runtime.CompilerServices.TaskAwaiter1.GetResult()在 BC_Menu.App.d__0.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)在 System.Runtime.CompilerServices.TaskAwaiter1.GetResult()在 BC_Menu.StartUp.FirstPage.d__4.MoveNext()--- 从上一个抛出异常的位置开始的堆栈跟踪结束 ---在 System.Runtime.CompilerServices.AsyncMethodBuilderCore.b__3(Object state)} System.Exception
  • _exception {System.Exception: Exception from HRESULT: 0x880403E8 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at BC_Menu.App.<UploadChannel>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at BC_Menu.StartUp.FirstPage.d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.AsyncMethodBuilderCore.b__3(Object state)} System.Exception

如果我在另一台设备(lumia 920)上尝试,它工作正常.设备之间的直接区别是我在 Lumia 640 上有一个虚拟帐户并且没有 SIM 卡,但我能够安装和更新程序.这应该意味着帐户已正确初始化.还有什么问题?

If I try on another device (lumia 920), it works fine. The immediate difference between the devices are that I have a dummy account on the Lumia 640 and no sim card, but I am able to install and update programs. Which should mean the account is correctly initialized. What else could be the issue?

推荐答案

您崩溃是因为 Windows.Networking.PushNotifications.PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync() 调用引发异常,因为设备未连接到 WNS.确保您处理这种情况(例如使用 try/catch) - 您的用户可能并不总是连接到互联网,这是获取频道所必需的.

You're crashing because the Windows.Networking.PushNotifications.PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync() call is throwing an exception because the device is not connected to WNS. Make sure you handle that case (e.g. with a try/catch) - your users may not always be connected to the internet, which is required to get a channel.

至于为什么该设备未连接到 WNS - 如果您没有 SIM 卡,则该设备应通过 Wi-Fi 连接.如果您在企业中进行开发,请确保它们不会阻止出站连接(这会导致设备无法连接到 WNS).如果您安装了 SIM 卡但没有数据,则存在一个已知错误,即设备仍会尝试通过蜂窝数据连接(当然会失败).如果是这种情况,只需移除无数据 SIM 卡或禁用蜂窝网络.

As for why that device isn't connecting to WNS - if you have no SIM card, the device should connect via Wi-Fi. If you're developing in an enterprise make sure they're not blocking outbound connections (which would cause the device to be unable to connect to WNS). If you have a SIM card installed but it has no data, there is a known bug where the device will still try to connect via cellular data (which of course fails). If that's the case, just remove the data-less SIM or disable cellular.

这篇关于设备上的 WNS 错误 0x880403E8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆