解析特定的iOS推送目标

时间:2016-01-15 09:44:39

标签: ios objective-c parse-platform push-notification

我正在尝试向特定的PFUser发送推送。对于每个PFInstallation,我有一个指向Parse内部User类的指针。我以前做过这个,但由于某种原因它失败了。

PFUser *gameOwner = [gameObject objectForKey:@"Defender"];

PFQuery *pushQuery = [PFInstallation query];
[pushQuery whereKey:@"user" equalTo:gameOwner];

PFPush *push = [[PFPush alloc] init];
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
                      [NSString stringWithFormat:@"New Game Started From %@!", [PFUser currentUser][@"Name"]], @"alert",
                      @"Increment", @"badge",
                      @"default", @"sound",
                      nil];
[push setQuery:pushQuery];
[push setData:data];
[push sendPushInBackground];

任何线索有什么问题?

0 个答案:

没有答案