所以我只是想用解析来设置我的新应用程序。我已经下载了他们的 SDK 并粘贴了我的 applicationID。问题出在推送通知(我什至没有碰过)。有人可以帮帮我吗? 谢谢
错误代码:
PFPush.subscribeToChannelInBackground("") { (succeeded: Bool, error: NSError?) in
if succeeded {
print("ParseStarterProject successfully subscribed to push notifications on the broadcast channel.\n");
} else {
print("ParseStarterProject failed to subscribe to push notifications on the broadcast channel with error = %@.\n", error)
}
}
}
它说:
Cannot invoke 'subscribeToChannelInBackground' with an argument list of type '(String, (Bool, NSError?) -> ())'
最佳答案
您显示的代码是订阅通知 channel ...并且它提示它不期望这些参数类型。
要设置 Parse SDK,请按照以下步骤操作:https://www.parse.com/apps/quickstart#parse_data/mobile/ios/swift/existing
根据解析入门指南,这就是他们测试安装是否良好(快速)的方式
let testObject = PFObject(className: "TestObject")
testObject["foo"] = "bar"
testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in
print("Object has been saved.")
}
关于ios - 解析不会编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34898551/