Parse push notifications changed with swift 3

ios parse-platform push-notification swift3

447 просмотра

1 ответ

90 Репутация автора

After I switched to swift 3/xcode 8 I get this error enter image description here

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)
                }
            })
Автор: manatee Источник Размещён: 19.07.2016 04:43

Ответы (1)


0 плюса

6 Репутация автора

Give this a try:

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)
            }
        })
Автор: techmann Размещён: 13.09.2016 10:49
Вопросы из категории :
32x32