2014-05-19 174 views
1

我使用Parse SDK创建并发送推送通知,但是我发现我的通知都没有到达。难道我做错了什么?我已经设置了应用程序ID和供应配置文件正确,因为我可以从设备发送推送通知后,从仪表板Parse.com发送测试通知推送通知未发送 - 解析SDK

 // 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]; 
+0

您是否检查过查询以确保它肯定返回结果?如果是的话,Parse的服务器上会显示哪些内容? – Logan

+0

嗨... Plz你能说出这条线上的用户是什么... [pushQuery whereKey:@“user”equalTo:otherUser]; –

回答

0

检查“推送通知”一节中的解析。

检查用户,如果用户是零则意味着:

  1. 无论是查询是错误的,不返回用户。
  2. 用户设备未注册。
  3. 对于用户的创建和设备注册,您正在使用自定义 类。它需要注册用户内置的解析用户类别 。

希望这些事情能帮助你。我面临同样的问题。