【发布时间】:2014-07-10 01:59:33
【问题描述】:
我正在尝试向用户或所有用户的列表发送推送通知。我可以使用这个 sn-p 在 ios 设备上成功发送(和接收):
// Create our Installation query
PFQuery *pushQuery = [PFInstallation query];
[pushQuery whereKey:@"deviceType" equalTo:@"ios"];
// Send push notification to query
[PFPush sendPushMessageToQueryInBackground:pushQuery
withMessage:@"Hello World!"];
但是这个 sn-p 不起作用:
PFQuery *userQuery = [PFUser query];
NSLog(@"findObjects: %@",[userQuery findObjects]);
[userQuery findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
NSLog(@"findObjectsInBackgroundWithBlock error: %@", error);
NSLog(@"findObjectsInBackgroundWithBlock objects: %@", objects); //this log indicated I do have one user named "user name"
}];
PFQuery *pushQuery = [PFInstallation query];
// [pushQuery whereKey:@"user" matchesQuery:userQuery];
[pushQuery whereKey:@"username" containsString:@"user name"]; //neither one of these works
// Send push notification to query
[PFPush sendPushMessageToQueryInBackground:pushQuery
withMessage:@"for you only"];
在 parse.com 网站的推送通知仪表板上,它的状态为“完成”,但订阅者为 0。
有什么建议吗?
编辑:Parse 仪表板的更多详细信息:
【问题讨论】:
标签: ios parse-platform