Parse platform 解析找不到用户名

Parse platform 解析找不到用户名,parse-platform,Parse Platform,在我的应用程序中,Parse在注册或登录时收集一个ID号作为名称。我希望将通知推送到所有具有该ID号的用户,如下所示: @IBAction func sendAlert(sender: AnyObject) { print ("Pushing for \(theIDNumber)") //this variable is correct // Create our Installation query let pushQuery = PFInstallation.que

在我的应用程序中,Parse在注册或登录时收集一个ID号作为名称。我希望将通知推送到所有具有该ID号的用户,如下所示:

@IBAction func sendAlert(sender: AnyObject) {

    print ("Pushing for \(theIDNumber)") //this variable is correct
    // Create our Installation query
    let pushQuery = PFInstallation.query()
    pushQuery!.whereKey("username", equalTo: (theIDNumber))
    print(pushQuery!.whereKey("username", equalTo: (theIDNumber))) // this returns a value of <PFQuery: 0x15c7bc0d0>

    // Send push notification to query
    let push = PFPush()
    push.setQuery(pushQuery) // Set our Installation query
    push.setMessage(theMessageBlank.text!) 
    push.sendPushInBackground()
    print("Message pushed")


}
@IBAction func sendAlert(发送方:AnyObject){
打印(“推送\(theIDNumber)”//此变量正确
//创建我们的安装查询
让pushQuery=PFInstallation.query()
pushQuery!.whereKey(“用户名”,等于:(他们的号码))
print(pushQuery!.whereKey(“username”,equalTo:(theIDNumber))//返回的值为
//向查询发送推送通知
let push=PFPush()
setQuery(pushQuery)//设置我们的安装查询
push.setMessage(theMessageBlank.text!)
push.sendPushInBackground()
打印(“推送消息”)
}
解析网站的结果是推送成功,但发送给零人。解析网站确实显示有一个人拥有请求的ID号

我看到ID号没有出现在Parse data browser的安装窗格中,我看到我正在设置PFInstallation查询。这就是问题所在吗?将其更改为PFUser.query没有帮助

谢谢,


Eli

所以您没有使用
用户名
添加和更新安装?谢谢,我感谢您的帮助!虽然你没有真正回答这个问题,但你似乎试图使用一些不存在的东西……我的问题只是我没有足够仔细地阅读文档。如果我读过它们,我就会知道saveinbackgroundithblock和channels。