【发布时间】:2014-08-06 12:35:06
【问题描述】:
我已将用户指针保存在安装类中。 Web 后端显示 0 个订阅者
我正在使用以下代码发送通知
PFQuery *qry = [PFUser query];
[qry getObjectWithId:friendObject.objectId]; //friend object is ok like @"Fefl5x7nhl"
PFQuery *pushQuery = [PFInstallation query];
[pushQuery whereKey:@"user" matchesQuery:qry];
// Send push notification to query
PFPush *push = [[PFPush alloc] init];
NSString *msgString=[NSString stringWithFormat:@"%@ :%@",
[newMessage objectForKey:@"userName"],
tfEntry.text];
[push setQuery:pushQuery]; // Set our Installation query
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
msgString, @"alert",
@"ursound.caf", @"sound",
@"Increment", @"badge",
// @"Optionally a type was set", @"type",
nil];
[push setData:data];
[push sendPushInBackground];
我的安装类确实有这个用户指针(朋友对象),逻辑上它应该是通知的接收者。
我错过了什么吗?任何建议都会很棒。感谢您宝贵的时间
【问题讨论】:
-
请再次发布您的答案
标签: ios push-notification parse-platform parse-framework