2016-07-19 192 views
0

改變後,我切換到SWIFT 3/Xcode中8我得到這個錯誤enter image description here解析推送通知與SWIFT 3

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) 
       } 
      }) 
+0

你有沒有成功地做任何事情?你有沒有嘗試在解析服務器的github上打開一個問題? –

回答

0

試試這個:

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) 
      } 
     })