我在安装类中保存了用户指针。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];
我的安装类确实有这个用户指针(朋友对象),逻辑上它应该是通知的接收者。
我错过了什么吗?任何建议都会很棒。感谢您宝贵的时间