I am trying to send a push notification to a user or list of all users. I can successfully send (and receive) on ios devices with this snippet:
// Create our Installation query
PFQuery *pushQuery = [PFInstallation query];
[pushQuery whereKey:@"deviceType" equalTo:@"ios"];
// Send push notification to query
[PFPush sendPushMessageToQueryInBackground:pushQuery
withMessage:@"Hello World!"];
But this snippet does not work:
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"];
On parse.com site's Push Notifications dashboard, it has a status of "done" but the Subscribers is 0.
Any suggestions?
Edit: More detail from Parse's dashboard:
