来自IOS Xcode的Azure推送通知错误

我觉得我是宇宙中第一个试图让iOS迅速与Azure合作的人,没有太多的帮助.

我跟着这个
Create an iOS app

然后
Add Push Notifications to your iOS App.我应该能够从iPhone做一个成功的推送通知,但是我收到了这个错误.顺便说一句:我可以让我的C#代码在我的电脑中使用Visual Studio触发(使用这个
tutorial),所以请求似乎正在运行,但响应很糟糕.任何人都知道如何解决它!

Error registering for notifications:  Optional("Error Domain=com.Microsoft.MicrosoftAzureMobile.ErrorDomain Code=-1302 \"{\"message\":\"An error has occurred.\"}\" UserInfo={com.Microsoft.MicrosoftAzureMobile.ErrorRequestKey=<NSMutableURLRequest: 0x14cebf780> { URL: http://<mysite>.azurewebsites.net/push/installations/1E32E9B5-E976-4CCD-BD61-D026D3F4FF1C }, com.Microsoft.MicrosoftAzureMobile.ErrorResponseKey=<NSHTTPURLResponse: 0x14cec54b0> { URL: http://<mysite>.azurewebsites.net/push/installations/1E32E9B5-E976-4CCD-BD61-D026D3F4FF1C } { status code: 500, headers {\n    \"Content-Length\" = 36;\n    \"Content-Type\" = \"application/json; charset=utf-8\";\n    Date = \"Wed, 11 May 2016 21:39:39 GMT\";\n    Server = \"Microsoft-IIS/8.0\";\n    \"Set-Cookie\" = \"ARRAffinity=8d79cd782ff16b44f7f280b76e2bc5564d86e0d1b228227b8e0033f4bb1c4582;Path=/;Domain=<mysite>.azurewebsites.net\";\n    \"X-Powered-By\" = \"ASP.NET\";\n} }, NSLocalizedDescription={\"message\":\"An error has occurred.\"}}")

更新#1
我唯一的网址是每个教程的网址.其余的代码与我在链接中提到的代码相同(我逐个字符地复制它):

class ClientManager {
    static let sharedClient = MSClient(applicationURLString: "http://<mysite>.azurewebsites.net")
}

更新#2
@Pau Senabre我正在根据我的问题使用swift而不是Objective-C(请参阅我的标签),所以我的步骤#1没有.m文件.我也没有你提到的logErrorIfNotNil.我的方法(在修改之前由Azure生成)看起来像这样:

@IBAction func addItem(sender : AnyObject) {
    self.performSegueWithIdentifier("addItem", sender: self)
}

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!)
{
    if segue.identifier == "addItem" {
        let todoController = segue.destinationViewController as! ToDoItemViewController
        todoController.delegate = self
    }
}

更新#3
@Pau Senabre我的目标是做移动应用/服务,而不是移动互动.看到差异here.顺便说一下:当我开始玩它并为我工作时,我已经按照了天蓝色的订婚示例.但我现在需要的是网络/移动应用程序.那么,你的建议仍然适用于我的需求吗?

最佳答案 你能发一些代码吗?我想你可能在某个地方使用了错误的网址.

点赞