向 Visual Studio Cordova 项目添加推送通知

Add push notifications to Visual Studio Cordova Project

我尝试关注 MSDN 杂志上的这篇文章 enter link description here to add iOS push notifications. However the sample code they provide enter link description here is outdated(using VS2013). I tried to migrate the project to VS2015 by following enter link description here,但仍然无法正常工作。

任何人都可以提供一个在 VS2015 中工作的示例代码吗?谢谢!

您需要配置通知中心以向您的 iOS 应用发送通知。

以下是如何逐步完成此操作的示例:

https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-ios-get-started/

希望对您有所帮助。

我已经将我的 fork 中的示例更新为 Visual Studio 2015:https://github.com/ggailey777/mobile-services-samples/tree/master/CordovaNotificationsArticle 为了让它工作,我还需要添加白名单插件,现在这是从 Cordova 应用程序访问远程服务的要求。 我正在等待将它合并回上游分支,直到我可以在 iOS 上对其进行测试(它现在可以在 Android 上运行)。正如 mostafa 指出的那样,您还需要按照步骤为 iOS 配置推送通知,其中包括在 Mac 上的 Xcode 中做一些事情。