【问题标题】:Parse push notifications changed with swift 3使用 swift 3 更改解析推送通知
【发布时间】:2016-07-19 04:43:23
【问题描述】:

切换到 swift 3/xcode 8 后,我收到此错误

let pushQuery = PFInstallation.query()!
            pushQuery.whereKey("user", equalTo: userpointer)
            let push = PFPush()
            push.setQuery(pushQuery) //This is where the error shows up

            push.setMessage("Test")
            push.sendInBackground(block: { (success: Bool, error: NSError?) in
                if(error == nil){
                    print("pp \(success)")
                }else{
                    print(error)
                }
            })

【问题讨论】:

  • 你有办法解决它吗?您是否尝试在 parse-server 的 github 上打开问题?

标签: ios parse-platform push-notification swift3


【解决方案1】:

试试这个:

let pushQuery = PFInstallation.query()
        pushQuery?.whereKey("user", equalTo: userpointer)
        let push = PFPush()
        push.setQuery(pushQuery as! PFQuery<PFInstallation>?)
        push.setMessage("Test")
        push.sendInBackground(block: { (success: Bool, error: NSError?) in
            if(error == nil){
                print("pp \(success)")
            }else{
                print(error)
            }
        })

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-17
    • 2017-10-10
    • 2012-03-15
    • 1970-01-01
    • 2014-12-17
    • 1970-01-01
    相关资源
    最近更新 更多