我想为 Xamarin Forms Windows 8.1 Silverlight 项目配置推送通知。最初我使用的是 MPNS,但正在尝试切换到 WNS。切换我现在在尝试调用方法以将我的设备注册到 Azures 通知中心时遇到错误。
引发错误的即时调用行是:
await App.MobileService.GetPush().RegisterAsync(channel.Uri);
抛出的错误是:
The type name 'MobileService' does not exist in the type 'App'
我安装了 NuGet 包 Microsoft.WindowsAzure.MobileServices 但显然这不包含定义。
我正在按照以下指南设置我的推送通知(在“将推送通知添加到您的应用程序”部分下):
我还查看了如何在其他网站上执行此操作,但我没有看到说明有太大差异,也没有看到我可能遗漏的内容......
无论如何,如果有人知道我可能缺少什么包或参考(或者该调用可能有什么问题),我将不胜感激!谢谢!