使用iOS解析推送通知

时间:2015-01-01 00:39:37

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

我尝试向用户发送通知。 继承我的代码

PFQuery *qry = [PFUser query];
[qry getObjectWithId:user.objectId];

PFQuery *pushQuery = [PFInstallation query];
[pushQuery whereKey:@"user" matchesQuery:qry];

// Send push notification to query
PFPush *push = [[PFPush alloc] init];
[push setQuery:pushQuery]; // Set our Installation query
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
                      @"A New Push Message was Put HERE!", @"alert",
                      @"ursound.caf", @"sound",
                      @"Increment", @"badge",
                      @"Optionally a type was set", @"type",
                      nil];
[push setData:data];


[push sendPushInBackground];    

但是,当我发送它时,没有任何效果。在Parse推送通知面板上显示

按下已发送0

当我通过&#34发送(作为测试)时,发送推送"按钮,没关系。

任何帮助?

0 个答案:

没有答案