Ios 解析PFPush-增量标记不工作

Ios 解析PFPush-增量标记不工作,ios,parse-platform,apple-push-notifications,Ios,Parse Platform,Apple Push Notifications,我正在使用iOS上的客户端SDK发送推送。 徽章增量似乎没有任何作用。 是否因为此属性仅在向频道发送推送时有效 NSPredicate *predicate = [NSPredicate predicateWithFormat:@"USERNAME == %@", user]; PFQuery *pushQuery = [PFQuery queryWithClassName:USER predicate:predicate]; PFPush *push = [[PFPush alloc] ini

我正在使用iOS上的客户端SDK发送推送。 徽章增量似乎没有任何作用。 是否因为此属性仅在向频道发送推送时有效

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"USERNAME == %@", user];
PFQuery *pushQuery = [PFQuery queryWithClassName:USER predicate:predicate];
PFPush *push = [[PFPush alloc] init];
[push setQuery:pushQuery];
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
                      @"message", @"alert",
                      @"Increment", @"badge",
                      @"default.wav", @"sound",
                      nil];
[push setData:data];
[push sendPushInBackground];

发送此邮件时,您是否收到任何通知?如果不是,我相信这是因为您没有正确设置安装查询,并且根本没有发送通知。创建查询时,需要执行以下操作:

PFQuery* query = [PFInstallation query];
[query whereKey:@"user" equalTo:user];  //  Or however else you have linked a user to your installations

它现在似乎起作用了。我的代码中没有任何更改,不确定这是否是解析中的某个错误导致的。

我收到了通知,而且通知声音工作正常。只是“增量”不起作用。如果我为badge硬编码一个像“5”这样的值,也可以。我建议将其作为开发者的bug报告打开。facebook.com尝试打开bug报告,但bug报告工具本身似乎不适合我。当我点击submit时,什么也没有发生:/