【问题标题】:Why Parse push.setQuery not working on Swift?为什么 Parse push.setQuery 在 Swift 上不起作用?
【发布时间】:2016-04-02 07:57:49
【问题描述】:

当其他用户点击“收藏”按钮时,我正尝试向帖子的所有者发送通知,但我收到错误消息:

不能同时设置查询和通道属性。

会是什么?我当前的代码:

let query = PFInstallation.query()
if let query = query {
    query.whereKey("installationUser", equalTo: self.job!["owner"]! as! String)
    let push = PFPush()
    push.setChannel("Global")
    push.setMessage("Some cool text here")
    push.setQuery(query)
    push.sendPushInBackground()
}

每当我执行push.setQuery(query)这一行时,应用程序就会崩溃

【问题讨论】:

  • 我认为这是预期的行为。将推送通知设置到频道(可以针对许多用户)和重叠的安装是没有意义的。一个比另一个更具体。
  • 谢谢@pbush25 o/ 我刚刚删除了 push.setChannel("Global") 行,现在一切正常!

标签: ios swift parse-platform push-notification push


【解决方案1】:

删除行 push.setChannel("Global")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多