【发布时间】:2016-09-04 18:02:18
【问题描述】:
我正在尝试在我的 .Net 后端和 azure 中的 ios 客户端之间设置成功的推送通知。我按照this 示例附加到我的调试器,并且能够通过我的 iphone 和 iMac 的操作在我的 pc 的视觉工作室中达到断点
结果对象既不抛出错误也不返回结果!
所以,我改变了方向,现在尝试通过仅在 Azure 中发送测试发送来进行调试(见图)。我再次收到一条消息:“成功发送测试消息。结果 {0 通过,0 失败}”但我的 iphone 上没有任何显示。 我认为这种行为类似于代码中的行为,解决一个将解决另一个: A. 是否可以安全地假设因为我在代码中遇到断点,所以我在 Apple Developer 中的设置是正确的? B. 你怎么知道 0 Passed 和 0 failed 的奇怪信息!?
更新 #1 - 韦斯利麦克斯温: 谢谢回答。我正在关注这个tutorial,它有这个快速注册:
func application(application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
application.registerUserNotificationSettings(
UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound],
categories: nil))
application.registerForRemoteNotifications()
return true
}
我可以很好地单步执行该代码。顺便说一句,这个其他方法的完成处理程序中的错误是 nil:
func application(application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
ClientManager.sharedClient.push?.registerDeviceToken(deviceToken) { error in
print("Error registering for notifications: ", error?.description)
}
}
【问题讨论】:
标签: ios .net iphone azure push-notification