我已经将我的iOS应用程序与自我托管的解析后端连接起来,我在iOS应用程序上实现了实时数据更新的实时查询。订阅后,它会显示me和error:WebSocket did disconnect with error: Optional(Starscream.WSError(type: Starscream.ErrorType.upgradeError, message: "Invalid HTTP upgrade", code: 403))
我在AppDelegate中的连接:
let parseConfig = ParseClientConfiguration {
$0.applicationId = "myAppId"
$0.clientKey = "fashionclip"
$0.server = "https://parse.knowell.xyz/parse"
}
Parse.initialize(with: parseConfig)在我的ViewDidLoad:
var armorQuery: PFQuery<Armor> {
return (Armor.query()!
.whereKeyExists("Name")
.order(byAscending: "createdAt")) as! PFQuery<Armor>
}
client = ParseLiveQuery.Client(server: "https://parse.knowell.xyz/parse")
subscription = client.subscribe(armorQuery)
// handle creation events, we can also listen for update, leave, enter events
.handle(Event.created) { _, armor in
print("\(armor.Name)")
self.sarverData = armor.Name
self.myTableView.reloadData()
}发布于 2019-08-29 00:17:08
你要在哪里主持?这是AWS和NGINX常见的问题。
您可以配置您的NGINX或类似的。
https://github.com/SoBump/ParseLiveQueryHelp/blob/master/guide.md
https://stackoverflow.com/questions/57637663
复制相似问题