【发布时间】:2014-05-19 12:45:55
【问题描述】:
我正在使用Parse SDK 创建和发送推送通知,但是我发现我的通知都没有到达。难道我做错了什么?我已经正确设置了 App ID 和 Provisioning Profile,因为我可以从 Parse.com Dashboard 发送测试通知
// Create new Push Notifications
PFQuery *pushQuery = [PFInstallation query];
[pushQuery whereKey:@"user" equalTo:otherUser];
NSString *pushNotificationMessage = [NSString stringWithFormat:@"%@ added you",[[PFUser currentUser] username]];
// Send push notification to query
PFPush *push = [[PFPush alloc] init];
[push setMessage:pushNotificationMessage];
NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:@"added you",@"Alert", nil];
[push setData:dict];
[push setQuery:pushQuery];
[push sendPushInBackground];
【问题讨论】:
-
您是否检查了查询以确保它确实返回了结果?如果是,推送是否显示在 Parse 的服务器上?
-
嗨...请您描述一下这一行中的用户是什么... [pushQuery whereKey:@"user" equalTo:otherUser];
标签: ios objective-c parse-platform