I am trying to setup a successfull push notifications between my .Net backend and ios client in azure. I followed this https://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-how-to-troubleshoot/#RuntimeDebugging example to attach to my debugger and was able to get as far as hitting a break point in my visual studio in my pc by an action from my iphone with an iMac
结果对象既不抛出错误也不返回结果!
因此,我改变了方向,现在尝试通过仅在 Azure 中发送测试发送来进行调试(参见图片)。我再次收到一条消息:“成功发送测试消息。结果 {0 通过,0 失败}”,但我的 iPhone 上没有显示任何内容。
我认为这种行为与代码中的行为类似,解决一个问题就会解决另一个问题:
答:既然我在代码中遇到了断点,那么可以安全地假设我在 Apple Developer 中的设置是正确的吗?
B. 你会如何找出“0 Passed and 0 failed!”的奇怪消息?
更新 #1 - 韦斯利·麦克斯温:
谢谢回答。我正在关注这个tutorial https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-ios-get-started-push/其注册速度如此之快:
func application(application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
application.registerUserNotificationSettings(
UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound],
categories: nil))
application.registerForRemoteNotifications()
return true
}
我可以很好地单步执行该代码。顺便说一句,此其他方法的完成处理程序中的 error?.description 为零:
func application(application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
ClientManager.sharedClient.push?.registerDeviceToken(deviceToken) { error in
print("Error registering for notifications: ", error?.description)
}
}